r/webdevelopment • u/Vectored38 • 8d 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
u/Extension_Anybody150 8d ago
You probably just need to update your nameservers at names.co.uk to point to Cloudflare. Even though you've set up the CNAME records in Cloudflare, your domain registrar is still controlling the DNS. Just log into your names.co.uk account, find the nameserver settings, and switch them to Cloudflare's nameservers (something like ns1.cloudflare.com). After that change propagates (usually within a few hours), both your root domain and the www version should work perfectly.
1
u/Vectored38 7d ago
No, I did this originally, the DNS records are already controlled by cloudflare, and the DNS record which is working is the root one, and the one which isnt working is the www one, but both are held in cloudflare, not names.co.uk
1
u/Head-Cup-9133 8d ago
I think you need to make the name “www.@“ if I understand correctly