DNS A Record for Cloudflare Pages website

What should be the IP address for the DNS A Record for my cloudflare hosted pages website's custom domain? My current DNS record for the pages.dev's custom doamin is:
CNAME custom-domain.com website.pages.dev Proxied Auto
CNAME custom-domain.com website.pages.dev Proxied Auto
And I get the following messages on the DNS records of the pages website:
Add an A, AAAA, or CNAME record for www so that www.custom-domain.com will resolve.

Add an A, AAAA, or CNAME record for your root domain so that custom-domain.com will resolve.
Add an A, AAAA, or CNAME record for www so that www.custom-domain.com will resolve.

Add an A, AAAA, or CNAME record for your root domain so that custom-domain.com will resolve.
I thought I was smart and I set the CNAME for www -> custom-domain.com since there's a CNAME (custom-domain.com -> website.pages.dev) already. But nope! I got 522 errors So I undid it . And I read this as well https://community.cloudflare.com/t/where-can-i-find-the-ip-adress-of-the-web-server-on-cloudflare-pages/636819/7?u=pratt which says "You need to delete any records that you created for www. Custom hostnames for Cloudflare Pages need to be added from the Pages menus, not the DNS app. The appropriate DNS entry will be created automatically since you use Cloudflare DNS." As it stands now, the apex domain custom-domain.com resolves properly. But www.custom-domain doesn't resolve properly. I get DNS_PROBE_POSSIBLE - www.custom-domain.com DNS address could not be found. Diagnosing the problem. . How do i fix this? I haven't worked with DNS records for many years. Please help. edit: I just put 192.0.2.1 as the IP address for A Record for www as per this https://developers.cloudflare.com/pages/how-to/www-redirect/ Haven;t set the bulk redirection list. Will this work? Waiting for some time to confirm Nope.... not yet whatsmyDNS gives noerror for www.custom-domain.com but dig gives an error for www.custom-domain.com Nope....getting 522 errors again.
Cloudflare Docs
Redirecting www to domain apex · Cloudflare Pages docs
Learn how to redirect a www subdomain to your apex domain (example.com).
17 Replies
Chaika
Chaika4w ago
You just need to add www.custom-domain.com as a Custom Domain from within the Pages Project
WhoseThere
WhoseThereOP4w ago
Done that
Chaika
Chaika4w ago
what's the custom domain? Could just be dns cache
WhoseThere
WhoseThereOP4w ago
ativerc.com
Chaika
Chaika4w ago
What's the record on www point to? If you modified it to 192.0.2.1, you'll need to delete that and readd the Custom domain, or manually make the CNAME to your pages.dev
WhoseThere
WhoseThereOP4w ago
CNAME -> ativerc.com zxybz.pages.dev
Chaika
Chaika4w ago
no, for the www subdomain
WhoseThere
WhoseThereOP4w ago
A www 192.0.2.1
Chaika
Chaika4w ago
yea, delete and readd Custom Domain in Pages Project would be the easiest way to get it proper again 192.0.2.1 is special for bulk redirects because it's basically saying "Some setting in this zone/account (bulk redirects) will handle the traffic before it reaches an origin to try", but Pages is a separate origin in ways/requires a specific setup
WhoseThere
WhoseThereOP4w ago
ativerc.com works. www.ativerc.com doesn't. Deleting that A record right now Will wait and see if it propagates. But to be honest I added the custom domain on pages a few days ago and if it had to happen, it would have worked by now.
Chaika
Chaika4w ago
What you should end up with is: The www.ativerc.com hostname listed under your Pages Project Custom Domains, leaving you with two (being your root and www) the www record in your DNS being a cname to your pages.dev
WhoseThere
WhoseThereOP4w ago
Oh right right
Chaika
Chaika4w ago
seems fine to me now
No description
WhoseThere
WhoseThereOP4w ago
yeah I added the www subdomain as well . So I have CNAME for both ativerc.com and www to xyz.pages.dev thanks dude! wait @Chaika
dig www.ativerc.com @1.1.1.1

; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> www.ativerc.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4394
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; Query time: 6 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Thu Feb 06 02:15:14 IST 2025
;; MSG SIZE rcvd: 44
dig www.ativerc.com @1.1.1.1

; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> www.ativerc.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4394
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; Query time: 6 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Thu Feb 06 02:15:14 IST 2025
;; MSG SIZE rcvd: 44
❯ curl -i https://www.ativerc.com
curl: (7) Failed to connect to www.ativerc.com port 443 after 7 ms: Couldn't connect to server
❯ curl -i https://ativerc.com
HTTP/2 200
❯ curl -i https://www.ativerc.com
curl: (7) Failed to connect to www.ativerc.com port 443 after 7 ms: Couldn't connect to server
❯ curl -i https://ativerc.com
HTTP/2 200
Need to learn about DNS then
Chaika
Chaika4w ago
should be just dns cache
dig www.ativerc.com @1.1.1.1 +short 172.67.196.152 104.21.84.202
WhoseThere
WhoseThereOP4w ago
oh okay will keep checking BTW, any pointers where I more I have to learn about DNS. Things that I remember are: 1. DNS lookup sequence: DNS Recursor -> Root DNS Servers -> TLD Server -> Authoritative DNS servers 2. DNS Records: A, AAAA, CNAME, TXT, MX, etc. And that's about it. Commands: dig, doggo, nslookup Things that I don't remeber so well, DNS zones, types of domains ( i remember FQDN and apex), etc. Okay, I just checked with my ISP's DNS server, and it worked....
dig www.ativerc.com

; <<>> DiG 9.18.7 <<>> www.ativerc.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1064
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1472
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; ANSWER SECTION:
www.ativerc.com. 1164 IN A 104.21.84.202
www.ativerc.com. 1164 IN A 172.67.196.152

;; Query time: 0 msec
dig www.ativerc.com

; <<>> DiG 9.18.7 <<>> www.ativerc.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1064
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1472
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; ANSWER SECTION:
www.ativerc.com. 1164 IN A 104.21.84.202
www.ativerc.com. 1164 IN A 172.67.196.152

;; Query time: 0 msec
I don't know how DNS can't be propagated for 1.1.1.1 more DNS weirdness:
# from my router; check timestamp
dig www.ativerc.com @1.1.1.1

; <<>> DiG 9.18.7 <<>> www.ativerc.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41949
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; ANSWER SECTION:
www.ativerc.com. 300 IN A 104.21.84.202
www.ativerc.com. 300 IN A 172.67.196.152

;; Query time: 92 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Thu Feb 06 02:30:51 IST 2025
;; MSG SIZE rcvd: 76
# from my router; check timestamp
dig www.ativerc.com @1.1.1.1

; <<>> DiG 9.18.7 <<>> www.ativerc.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41949
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; ANSWER SECTION:
www.ativerc.com. 300 IN A 104.21.84.202
www.ativerc.com. 300 IN A 172.67.196.152

;; Query time: 92 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Thu Feb 06 02:30:51 IST 2025
;; MSG SIZE rcvd: 76
# From my laptop; check timestamp
dig www.ativerc.com @1.1.1.1

; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> www.ativerc.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 52464
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; Query time: 3 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Thu Feb 06 02:31:11 IST 2025
;; MSG SIZE rcvd: 44
# From my laptop; check timestamp
dig www.ativerc.com @1.1.1.1

; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> www.ativerc.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 52464
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.ativerc.com. IN A

;; Query time: 3 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Thu Feb 06 02:31:11 IST 2025
;; MSG SIZE rcvd: 44
Same via 9.9.9.9. dig fails on my pc. not on my router. @Chaika give this a look All I can do is have a screenshot to fix/troubleshoot this tomorrow haha I had to come back and make an updte here.... I had chrome and 10 tabs of terminator open. and discord open. I shut off discord, then chrome adn like 8 tabs of terminal. And ust for kicks I thought it would be nice to try digging the FQDN again. And it worked.....so I wonder if shutting down chrome updated it. don't know
Chaika
Chaika4w ago
I mean there's books like "DNS & BIND" or simply just experimenting/playing around with stuff. Go to the root, play around with BIND and hosting your own nameservers, etc. The latency on the dig from your laptop seems too low to be possible (3 ms), perhaps your router or ISP is hijacking dns to their own/caching proxy

Did you find this page helpful?