Quick answer: To serve docs on your own hostname, add the domain in your docs host, create the DNS record it gives you (a CNAME for a subdomain, an A or ALIAS record for the apex), complete the ownership check, and wait for the host to issue a TLS certificate. The switch only works once DNS resolves and the certificate is valid, so keep the old address reachable until both are confirmed.
Decide apex vs subdomain first
The record type depends on which hostname you want, not on personal preference. A subdomain such as docs.example.com is the easy path: you create a CNAME that points the name at the target your host provides, and the host can change its underlying IPs without you touching DNS.
The apex, the bare example.com, is different. The DNS standard says a name that holds a CNAME cannot hold any other record, while the apex must keep its SOA and NS records and usually its MX records for email. A plain CNAME at the root is therefore not allowed. You either point an A record at a fixed IP the host publishes, use an ALIAS or ANAME record (also called CNAME flattening), or simply redirect the apex to a subdomain. ALIAS and ANAME are provider features rather than standard record types; the provider resolves the target itself and returns ordinary A records, so check that your DNS host supports one before you plan around it.
The setup, in order
- Add the hostname in the docs platform and copy the target value or verification record it shows.
- Create the DNS record at your DNS provider: CNAME for a subdomain, A or ALIAS for the apex.
- Finish the ownership check. Some hosts use a TXT record or a second CNAME to prove you control the domain.
- Let the host provision a TLS certificate. This is usually automatic through an ACME-based issuer, but it cannot complete until the new record resolves.
- Confirm the new hostname loads over HTTPS, then set a redirect if you want the apex and
wwwto converge on one address. - Only after the new URL is confirmed, update links and retire any old hosting.
The platform you publish through has to support the hostname you want; Powerduck supports custom domains, including sub-path setups on a domain you already run. For the broader build-vs-buy call, see the docs platform comparison hub.
DNS records for each case
| Hostname | Record at your DNS host | What it does |
|---|---|---|
| docs.example.com | CNAME to the host target | Aliases the name to another hostname |
| example.com with fixed IP | A record to the published IP | Points the root directly at an address |
| example.com without fixed IP | ALIAS, ANAME, or flattened CNAME | Provider resolves the target to A records |
| Ownership check | TXT record or validation CNAME | Proves you control the domain |
| Apex to subdomain | Redirect rule | Sends root traffic to the subdomain |
Why TLS and verification add a step
Browsers refuse HTTPS without a valid certificate, and a certificate authority will not issue one for a name it cannot confirm. That is why the ownership check and certificate issuance sit between the DNS change and the real switch. If CAA records restrict which authorities may issue, make sure the host's issuer is allowed or the request stalls. Keep any required validation CNAME in place; removing it can break later renewals.
Failures that waste an afternoon
A proxied DNS record, such as an orange-cloud setup, can block validation, so switch it to DNS-only during issuance if the host asks. Long TTL values slow propagation, so lower the TTL before a planned migration. Sub-path setups are not a DNS change: they need a reverse proxy routing the path to the docs host, so a CNAME cannot produce example.com/docs. Do not delete the old hosting on the first good load; recheck from a clean resolver or a second network to confirm propagation rather than a cached result.
Frequently asked questions
Can I use a CNAME at the root? Not on a standards-compliant setup. Use an A record if the host publishes an IP, an ALIAS or ANAME if your DNS provider offers one, or redirect the apex to a subdomain.
How long does the switch take? The record propagates according to its TTL, often within minutes but sometimes hours, and the certificate issues only after the new record resolves. Keep the old URL live until the new one returns HTTPS from a clean resolver.
Do I need to manage the certificate myself? Most docs hosts issue and renew it automatically. You only need to keep the validation record and any CAA configuration compatible with their issuer.
The bottom line
A custom domain is not a single toggle; it is a short chain where DNS, ownership verification, and TLS each have to pass in order. Favor a subdomain CNAME unless you specifically need the apex, plan the record type around what your DNS host supports, and never tear down the old address before the new hostname returns a valid HTTPS page from a network that has not cached the result.
Comments
Join the discussionNo comments yet. Be the first to comment.

