DEV Community

Naveen
Naveen

Posted on

How to check if a website is down: status codes, HTTPS check and redirects

A site "looks down" for one of four reasons: your own network, DNS, the server, or the app behind it. Before you restart anything, find out which one it is. Here's the order I check things in, with the commands I use, and what each result actually means.

1. Is it down for everyone, or just for me?

First, rule yourself out. Open the site on mobile data instead of Wi-Fi, turn off any VPN or ad blocker, and try a private window. If it works there, the problem is local: a stale DNS cache, a company firewall, or a browser extension.

If it still fails, check from outside your network:

curl -sS -o /dev/null -w "%{http_code}  %{time_starttransfer}s\n" https://example.com
Enter fullscreen mode Exit fullscreen mode

This prints the HTTP status code and the time to first byte. A number means the server answered. An error like Could not resolve host or Connection timed out tells you which layer failed, which is the next step.

2. Read the error, not just "it's down"

What you see Where the problem is
Could not resolve host DNS: the domain doesn't point anywhere (expired domain, wrong record, nameserver change still spreading)
Connection refused / timeout Server: it's off, overloaded, or a firewall drops the traffic
SSL error Certificate: expired, wrong hostname, or a missing intermediate certificate
5xx status The server is up, but the application behind it failed
4xx status The server answered, but refused or couldn't find this URL

To check DNS on its own:

dig +short example.com A
dig +short example.com AAAA
Enter fullscreen mode Exit fullscreen mode

An empty answer means there's no record. An unexpected IP usually means a DNS change hasn't reached every resolver yet.

3. Status codes worth knowing by heart

  • 200: fine.
  • 301 / 308: permanent redirect. Fine for moved pages, but link to the final address directly.
  • 302 / 307: temporary redirect. If the move is permanent, use 301, or search engines keep the old URL in their index.
  • 403: forbidden. Often bot protection or file permissions. A site that works in your browser but returns 403 to a checker is usually blocking non-browser traffic on purpose.
  • 404: the page is gone. Restore it or redirect it to the closest match.
  • 500: application error. Go to the app's error log, not the web server's.
  • 502 / 504: the proxy (nginx, a load balancer, a CDN) couldn't get an answer from the app behind it in time.
  • 503: unavailable. That's often deliberate during maintenance, or a sign of rate limiting.

4. HTTPS check: is the connection actually secure?

The padlock only tells you the connection is encrypted. It doesn't tell you the certificate expires in three days. To see the dates:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
  | openssl x509 -noout -issuer -dates
Enter fullscreen mode Exit fullscreen mode

Renew anything with less than two weeks left. Then check the HTTP → HTTPS redirect:

curl -sIL http://example.com | grep -iE "^(HTTP|location)"
Enter fullscreen mode Exit fullscreen mode

A well set up site goes from http:// to https:// in one hop. Two or three hops (http → https → www → trailing slash) each add a full round trip before the page starts loading.

While you're there, look for the strict-transport-security header (HSTS). It tells browsers to use HTTPS on every later visit, so the insecure first request disappears.

5. Is it slow, or just far away?

Time to first byte is the number to watch. Google's guidance is to stay under 0.8 seconds, and well-cached pages often answer in under 200 ms. If the connect and TLS times are high but the server time is low, the server is just far from the visitor, and a CDN fixes that. If the server time itself is high, look at the code, the database queries or missing page caching.

One check instead of five

Running all of this by hand is fine when you're debugging your own server. When someone sends you a link and asks "is this site down?", it's quicker to run everything at once. I use a free website checker online that shows the status code, every redirect, the response time split into connect, TLS and server wait, the certificate expiry, the SEO tags, missing security headers and the DNS records in a single report, with no sign-up.

Whichever tool you use, keep the order: rule out your own network, then DNS, then the connection and certificate, then the application. Most "the site is down" messages turn out to be a stale DNS cache or an expired certificate, and you can tell which one in under a minute.

Top comments (0)