infrastructure//Cloudflare//Pages//custom domain

A custom domain is a name owned by the site operator and attached to a Pages project, so that the site answers at `demo.example.com` and not only at its pages.dev address. It takes two separate things, and having one without the other fails in a recognisable way.


A custom domain is a name owned by the site operator and attached to a Pages project, so that the site answers at demo.example.com and not only at its pages.dev address. It takes two separate things, and having one without the other fails in a recognisable way.

The first is a DNS record in the zone saying that the name goes to Cloudflare. DNS points the name.

The second is the name registered in the Pages project. A subdomain needs its name registered in the Pages project, each one separately: having www on the list does nothing for demo.

With the record and without the registration, the request reaches Cloudflare and no project claims it: the visitor sees error 522.

With the registration and without the record, the name resolves to nothing and never reaches the project.

For a subdomain the record can be a CNAME kept at any DNS provider. For the bare domain the rules are stricter, as apex explains.