I cannot seem to be able to connect pages to DNS
I've the site hosted via cloudflare pages and dns for my domain through cloudflare dns but I cannot seem to be able to find a way to connect them. The domain gets me an error page.
6 Replies
You need to add it to the Pages Project Custom Domain tab https://developers.cloudflare.com/pages/platform/custom-domains/
Custom domains · Cloudflare Pages docs
When deploying your Pages project, you may wish to point custom domains (or subdomains) to your site.
I get this warning though: "CNAME records normally can not be on the zone apex. We use CNAME flattening to make it possible."
It's because it's unproxied (DNS Only), if you do it through the Custom Domain tab, it will create/replace it for you, and also default to being proxied. Once it's proxied, Cloudflare will automagically resolve it internally.
Having it proxied also lets you get your normal website/zone analytics on it, firewall rules, redirects, waf, etc
Eitherway, you need to add it to the Pages Project Custom Domains tab for it to work at all. You can think of it like an allowlist, if anything not in your Custom Domain tab tries to CNAME to your pages project, it won't work
I've it proxied now but still getting it
It's just a warning, technically that's not even true because they don't need to CNAME flatten when proxied, but eitherway it's more them saying "If this was DNS-only, we have a workaround to make it still work for A/AAAA types"
Your site works fine for me
ok thank you