Opens in a new tab

Connect a domain to Cloudflare Pages: the DNS records

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

NameTypeValue
(root)NSThe two Cloudflare nameservers the account assigns
wwwCNAMEyour-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 domainOnly as a zone on Cloudflare
WildcardsNot 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

  1. For the root: add the domain to Cloudflare as a zone and change its nameservers at the registrar — turning DNSSEC off there first.
  2. In the Pages project, add the custom domain; Cloudflare creates the record when the zone is on the account.
  3. 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:

Know the moment your site stops answering

Add your site and we check it every few minutes, confirm a failure from another location — Europe, North America or Asia — before calling it down, and email you when it stops answering and when it is back. Free for two sites.

Create a free account