For the root domain, the domain must be a zone on the same Cloudflare account, with Cloudflare’s nameservers — Cloudflare then creates the record itself. A subdomain such as www or shop can stay at another DNS host as a CNAME to your-project.pages.dev, but only after it has been added in the project’s custom domains first.
The records to add
| Name | Type | Value |
|---|---|---|
(root) | NS | The two Cloudflare nameservers the account assigns |
www | CNAME | your-project.pages.dev |
Add the domain under the project’s Custom domains before creating the CNAME: a CNAME without it gives a 522 error.
| Root domain | Only as a zone on Cloudflare |
| Wildcards | Not supported |
Check your domain
Enter your domain: we look up its records and compare them with what Cloudflare Pages expects — the root, www, and any record left over from before.
Step by step
- For the root: add the domain to Cloudflare as a zone and change its nameservers at the registrar — turning DNSSEC off there first.
- In the Pages project, add the custom domain; Cloudflare creates the record when the zone is on the account.
- For a subdomain at another DNS host: add it in the project first, then create the CNAME to your-project.pages.dev.
What to remove
- To remove a custom domain, delete the DNS record first, then remove the domain from the project.
The certificate
Cloudflare issues the certificate once the domain is active. If you use CAA records, allow letsencrypt.org, pki.goog and ssl.com (issue and issuewild). The address /.well-known/acme-challenge/ must be reachable over HTTP, or the domain does not verify.
Common mistakes
- Creating the CNAME before adding the domain in the project — a 522 error.
- Expecting to point the root from another DNS host: it has to be a Cloudflare zone.
- Adding a domain that already has a Worker route or an Access policy.
Sources
Records checked on 26 September 2026 against these official sources:
- Custom domains — developers.cloudflare.com
- Known issues — developers.cloudflare.com