Pages DNS, CNAME @ to www

I am somewhat experienced with DNS and I’m using Cloudflare Pages with github to host my websites.

My current DNS
A, @, IP
CNAME, www, x. pages. dev

When I manually add the whatever.pages.dev to my C NAME, it’s doesn’t establish a connection. When I first connected a few pages, it would offer C NAME, www, x. pages. dev and the web page initialization was instantly working. After connecting a few sites, it changed from C NAME, www, x to C NAME, @, x. pages. dev. I can’t manually change the @ to www .

So now it overwrites my A record because of the conflicting @ and it says cname flattening. This completely breaks the sub domain www . I tried two having two C NAMES, @ and www and it doesn’t work

So my issue is, how do i force www instead of @ and why is it even doing this garbage to begin with? I can’t understand why cloudflare would code this broken C NAME suggestion.

Cloudflare forum somehow considers the word CNAME as a link and bothered me until I spaced every word out. If you’re wondering why I spaced it so goofy…

You need to add custom domains through the pages settings.
From the docs

Manually adding a custom CNAME record pointing to your Cloudflare Pages site - without first associating the domain (or subdomains) in the Cloudflare Pages dashboard - will result in your domain failing to resolve at the CNAME record address, and display a 522 error.

So you would need a custom domain for each @ and www.

4 Likes

Thank you! A very easy oversight but that was the fix. Inside Pages, once you go to link your website, make sure you connect ‘www. mysite. com’ instead of ‘mysite. com’

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.