Cloudflare pages + custom domain, www CName record not working

209 views Asked by At

I created a Cloudflare page sanket-sapate-github-io.pages.dev and connected it to sanketsapate.live
Both the links are working fine.

Now I want to add CName record www which redirects to any of two links.

After adding the record, visiting <www.sanketsapate.live> says Connection Timed out Error 522 even though both the previous url are working fine.

1 Created a cloudflare page named <sanket-sapate-github-io.pages.dev>.  
2 Connect the page to custom domain <sanketsapate.live>  
3 Created a CName record name=www target=@

www.sanketsapate.live is not working.
Error code 522, Connection timed out

1

There are 1 answers

0
nmishin On BEST ANSWER

Adding custom domain not enough, you need to do it a little bit different way, how described in that article: https://developers.cloudflare.com/pages/configuration/custom-domains/#add-a-custom-domain

In a nutshell: you need to setup a Custom domain via Pages "Custom domains" configuration.

How documentation says:

  • To ensure a custom domain is added successfully, you must go through the Add a custom domain process described above. 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.