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


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.


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
Learn how to redirect a www subdomain to your apex domain (example.com).
Was this page helpful?