Cloudflare Pages Custom Domain DNS Settings for Domain Registered at NameCheap

Hi all. I’m having a similar problem to that explained at https://community.cloudflare.com/t/correct-dns-for-cloudflare-pages/257017. I have a domain registered at NameCheap (.io TLD) and have thus far managed to:

  1. Connect a github repo to Cloudflare Pages
  2. Successfully hosted the site on xxx.pages.dev
  3. Configured the domain to use Cloudflare’s nameservers
  4. Attempted to configure the DNS settings in the Cloudflare Pages Custom Domain section.

However, the site will not load and after a while I usually end up with a 522 Error.

I’ve read a lot for hours but I’m sure there must be a simple solution to my settings. This is what I have so far:

Any suggestions greatly appreciated !

Error 522: connection timed out

Error 522 occurs when Cloudflare times out contacting the origin web server. Two different timeouts cause HTTP error 522 depending on when they occur between Cloudflare and the origin web server:

  1. Before a connection is established, the origin web server does not return a SYN+ACK to Cloudflare within 15 seconds of Cloudflare sending a SYN.
  2. After a connection is established, the origin web server doesn’t acknowledge (ACK) Cloudflare’s resource request within 90 seconds.

An HTTP 524 error occurs if the origin web server acknowledges ( ACK ) the resource request after the connection has been established, but does not send a timely response.

Resolution

Contact your hosting provider to check the following common causes at your origin web server:

  • (Most common cause) Cloudflare IP addresses are rate limited or blocked in .htaccess, iptables, or firewalls. Confirm your hosting provider allows Cloudflare IP addresses.
  • An overloaded or offline origin web server drops incoming requests.
  • Keepalives are disabled at the origin web server.
  • The origin IP address in your Cloudflare DNS app does not match the IP address currently provisioned to your origin web server by your hosting provider.
  • Packets were dropped at your origin web server.

If you are using Cloudflare Pages, verify that you have a custom domain set up and that your CNAME record is pointed to your custom Pages domain. Instructions on how to set up a custom Pages domain can be found here.

If none of the above leads to a resolution, request the following information from your hosting provider or site administrator before contacting Cloudflare support:

  • An MTR or traceroute from your origin web server to a Cloudflare IP address that most commonly connected to your origin web server before the issue occurred. Identify a connecting Cloudflare IP recorded in the origin web server logs.
  • Details from the hosting provider’s investigation such as pertinent logs or conversations with the hosting provider.

Many thanks for the reply. The only hosting I am using is with Cloudflare Pages and I had read the article you mentioned (several times) but did not find it particularly well-worded. I feel like I have followed the instructions as per the screenshot of my DNS settings. On one occasion, I managed to find my way back to the Custom Domains tab (not quite sure how I did that) and was told that it was already set up for this site.

Hey! Tell me which proxy you are using. I am a worktime developer and we previously used ipv6 proxy, there were situations like yours with it, then we started using ipv4 and everything worked out.

I’d double check that it is set up on the Pages Custom Domain tab.
You can find this by going: Pages > Site > Custom Domains
You need to specifically set up the Page to accept the CNAME this way or it will not work.
Hope that helps

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.