Website not working with DNS, but works with public IP

I have a website running on a Linux server within my network.

  1. I setup my website DNS (on Cloudflare) to point to my network’s public IP
  2. I created a Port Forwarding rule in my router for port 80 to forward to the Linux server running my website.
  3. When I navigate to http://gattufamily.com, I get HTTP error 522 with the below explanation. If I access using the public IP http://174.67.217.129, it works.

Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish.

You have not changed DNS at the domain registrar for new ones

My DNS in Cloudflare shows {Redacted} as my IP address (see screenshot below). However, I am seeing different IP addresses when I test with a DNS Checker. My IP has not propagated in over 2 days. How can I resolve this?

The IP address is not the issue

But your server generally does not appear to be reachable → sitemeer.com/#https://174.67.217.129

You probably best pause Cloudflare for now (Overview screen, bottom right), fix the server configuration, and unpause Cloudflare only when your site loads fine with a proper certificate.

2 Likes

I don’t have SSL setup on my web server yet. So, try http://174.67.217.129 (without https) in your browser - it loads instantly. However, Sitemeer.com reports that my website is down.

Precisely, because it’s down which is why Cloudflare can’t reach it either. You can probably access it because you are on the network.

Also, set up SSL, that should be at the very beginning actually.

1 Like

@sandro You are right that I can get to the website from my network but not outside my network - I just tested with WiFi turned off on my phone. Any ideas as to where to check next? I am assuming that the problem may be in the port forwarding configuration of my UniFi network.

I am afraid that would be a bit beyond the scope of the forum here. You probably need to tweak your router configuration. Check out StackExchange or Reddit for that.

Bottom line is, your site should first load fine on HTTPS and only then add it to Cloudflare. If it worked fine before you should not have any other issues then (assuming you do not block Cloudflare addresses).

1 Like

You can’t access an IP address directly, it’ll either be Error 1003: Direct IP access denied (if it’s a Cloudflare IP) or something like “ERR_CONNECTION_REFUSED” or “ERR_CONNECTION_TIMED_OUT”

No it does not! As I mentioned, you cannot access public IP’S (or Cloudflare IP’s) without getting an error! If you need futher proof of that, a screenshot is below showing you what happens if you try to access a public IP (like the one you provided)

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.

What DNS do you have entered at the domain registrar? I don’t think you changed them to the ones provided by Cloudflare after adding your domain.
Regarding dropping the connection on the external IP from inside, this is normal behavior to prevent loops on routers - you need to set a rule on your router that connections from inside to this IP are to be directed to the internal IP.

The issue is not DNS related but solely because the router is not properly configured.

dropping the connection is a matter for the router, but it still says the domain name is down.

Of course it says so, because the server is not reachable. We already established that hours ago :slight_smile:

Dig says something else :slight_smile:

What does it say? Since when does dig determine a server’s availability?

I’m not talking about the availability of the server, but that the domain name is not available. I think he should solve problems one by one. I would start by setting the router to DMZ mode, if it works, try to configure it, and then take care of the domain.

Well, but we are talking about the server all the time and that’s the issue. The whole thing is already addressed and the OP just needs to follow the suggestions and he is already doing that anyhow.

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