Custom Domain failing for cloudflare pages

Hey pages team, I just posted on the forums (https://community.cloudflare.com/t/cloudflare-pages-doesnt-work-with-custom-domain-on-cloudflare/539980) but I imagine I might be able to get faster help here. My setup is: Namecheap is my registrar. I made a cloudflare zone and used all of the defaults. (I added it yesterday and deleted it and added it again today). It uses dorthy.ns.cloudflare.com and quinton.ns.cloudflare.com. I made a cloudflare page, that works just fine accessed directly. text-extractors-test.pages.dev The page doesn’t work at all when accessed via the domain https://textextractors.com/ (which is setup via CNAME to the cloudflare zone). But when I try to go to the website, it just fails it. I can’t access it on multiple browsers, my cell phone (not on network). I’ve tried reseting local DNS and I’m just out of options and don’t know what to configure. When I navigate to the website via the domain, I get a "host error" but this is all managed by cloudflare and the pages.dev domain has no problem - what gives?
Cloudflare Community
Cloudflare Pages doesn't work with custom domain (on cloudflare)
Hi, I’ve got an issue with cloudflare pages and using a custom domain. My setup is: Namecheap is my registrar. I made a cloudflare zone and used all of the defaults. (I added it yesterday and deleted it and added it again today). It uses dorthy.ns.cloudflare.com and quinton.ns.cloudflare.com. I made a cloudflare page, that works just fine acc...
26 Replies
Erisa
Erisa16mo ago
A custom domain doesn't work on a CNAME alone, you need to go the Pages project settings and add the domain under the Custom Domains tab
bllchmbrs
bllchmbrsOP16mo ago
It is added there as well.
bllchmbrs
bllchmbrsOP16mo ago
bllchmbrs
bllchmbrsOP16mo ago
That's under the custom domain tab on the cloudflare pages... page.
Erisa
Erisa16mo ago
Alright, let me check
bllchmbrs
bllchmbrsOP16mo ago
Thank you!!!!
Erisa
Erisa16mo ago
It seems to work for me
bllchmbrs
bllchmbrsOP16mo ago
I saw it work yesterday. Then I started experiencing issues. I figured it was just DNS cache stuff, woke up this morning, and it kept failing. That's definitely the site!
Erisa
Erisa16mo ago
Thats strange indeed
bllchmbrs
bllchmbrsOP16mo ago
I just purged my local dns cache this is what I get:
bllchmbrs
bllchmbrsOP16mo ago
Now my url is "HTTP" instead of https but shouldn't cloudflare just be forcing HTTPS?
Erisa
Erisa16mo ago
It should, let me see That 523 seems to be a different error to the 522 you showed on community
bllchmbrs
bllchmbrsOP16mo ago
Yes, that is correct. also, when I try to enter https:// it just doesn't load - it times out.
Erisa
Erisa16mo ago
Oh you're trying the www.
bllchmbrs
bllchmbrsOP16mo ago
I'm sure I'm just stupid, but I don't understand why I have to monkey with all this stuff - I figured that cloudflare would be the one to manage it for me - that's at least instinctually why I chose the product. Am I wrong here in that his requires a lot more configuration that I initially thought?
curl -I -XGET "https://textextractors.com"
curl: (28) Failed to connect to textextractors.com port 443 after 75491 ms: Couldn't connect to server
curl -I -XGET "https://textextractors.com"
curl: (28) Failed to connect to textextractors.com port 443 after 75491 ms: Couldn't connect to server
Erisa
Erisa16mo ago
If you want the www. to serve the same website you need to add it as a custom domain also, or the recommended is a redirect: https://developers.cloudflare.com/pages/how-to/www-redirect/ Can you try curl -svo /dev/null https://textextractors.com
bllchmbrs
bllchmbrsOP16mo ago
Running that
bllchmbrs
bllchmbrsOP16mo ago
Is this correct ^
bllchmbrs
bllchmbrsOP16mo ago
That's what cloudflares pages custom domain created, I haven't changed those settings.
Erisa
Erisa16mo ago
A CNAME alone won't work and results in errors, you then need to add a Custom Domain entry or a redirect for the www. as well
bllchmbrs
bllchmbrsOP16mo ago
ACK, will do that now. Here is the result from the curl:
curl -svo /dev/null https://textextractors.com
* Trying 162.255.119.150:443...
* connect to 162.255.119.150 port 443 failed: Operation timed out
* Failed to connect to textextractors.com port 443 after 75447 ms: Couldn't connect to server
* Closing connection 0
curl -svo /dev/null https://textextractors.com
* Trying 162.255.119.150:443...
* connect to 162.255.119.150 port 443 failed: Operation timed out
* Failed to connect to textextractors.com port 443 after 75447 ms: Couldn't connect to server
* Closing connection 0
Erisa
Erisa16mo ago
That IP is a Namecheap IP Most likely your local device has the old DNS cached
bllchmbrs
bllchmbrsOP16mo ago
I have run:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
Is there something else I should run? Should I restart?
Erisa
Erisa16mo ago
It could still be cached on your router or at the upstream DNS provider. Do you use one provided by your ISP or another provider like 1.1.1.1/8.8.8.8?
bllchmbrs
bllchmbrsOP16mo ago
I have not modified it at all, so whatever is the expected default. I believe it is my personal router. ok, switched it to 8.8.8.8 and it works fine now. Thanks! (It was my router's) @erisachu , last comment - thank you!!!!
Erisa
Erisa16mo ago
No problem!
Want results from more Discord servers?
Add your server