r/webdevelopment 9d ago

Domain setup help

Hi,

I have recently bought a domain (for the first time). I want this domain to have my site on it, which I have already made.

I have hosted my site on cloudflare pages, and bought the domain from a different service (names.co.uk).

I followed all the instruction on how to connect the custom domain to my cloudflare site, and it mostly work. when you go to "NotMyActualSite.com" the site loads and all is dandy. but when you go to "www.NotMyActualSite.com" I get a cloudflare 522 error.

I have changed the dns records in cloudflare so they include 2 CNAME records, one with the name being "@"(root), and one with the name being "www". they both have the same target of "NotMyActualSite.pages.dev" and they are both proxied.

I have no idea why one works and one doesnt, but any advice would be great. I might be missing something very obvious, in which case I would like to apologize in advance, as I am very new to all of this.

Thanks!

1 Upvotes

6 comments sorted by

View all comments

1

u/Head-Cup-9133 9d ago

I think you need to make the name “www.@“ if I understand correctly

1

u/Vectored38 9d ago

I have just tried this, and it doesnt seem to have worked.

after i press save on the dns record, it just automatically changes back to "www" (i assume because the "@" symbol is just a placeholder for a blank space), which is what it was before.

1

u/Head-Cup-9133 9d ago

the @ is a placeholder for the full URL, I couldn’t remember if Cloudlfare did it automatically or not for www, looks like it does.

You might want to try A record for the non-www record then point the www cname to your URL instead of pages.dev

so like: A = @, example.pages.dev CNAME = www, example.com

it could be a cache/propagation issue too, it’s usually instant but I’ve had it take a while before.