ENGINEERING JOURNAL

Why I Check DNS and TLS Certificates First During an Outage

Before you open the server logs, check DNS and the TLS certificate. Two one-minute checks that catch the silent causes of a site appearing dead.

THE ARTICLE 01 — 02

When a site goes down, the instinct is to open the server logs. I do the opposite. I check DNS and the TLS certificate first. Both checks take under a minute, both fail silently when they break, and both look exactly like a dead server when they are the real cause. I have lost time chasing application bugs that turned out to be an expired certificate or a DNS record pointing at an old IP. Now the first two checks are always the same.

Why DNS and TLS fail first in practice

DNS and TLS sit in front of everything else. If DNS resolves to the wrong address, no request ever reaches your server, so your logs show nothing. If the certificate is expired or mismatched, browsers refuse the connection before your application runs a single line. Both problems are invisible from the server side. Your app can be perfectly healthy while every visitor sees an error page. That is why they come before log diving. Checking them first either finds the problem in sixty seconds or rules out two whole categories of failure.

Check DNS resolution from the outside

Start by asking what the world sees, not what your server thinks. Run this from your local machine:

dig +short example.com
dig +short www.example.com
nslookup example.com 8.8.8.8

Compare the returned IP against the IP your server actually has. If they differ, someone changed a record or a migration left a stale A record behind. Also check the TTL. A record with a 24-hour TTL takes a full day to fully roll over after a change, and during that window different visitors hit different servers. When I moved a site between hosts, a stale A record sent half the traffic to the old server for hours, and the old server served a blank page because the files were already gone. The fix was a DNS edit, not a server repair.

Check the TLS certificate expiry and name

Certificates expire quietly. Browsers show a scary full-page warning, visitors assume the site is hacked, and nobody emails you about it. Check expiry and the covered names with one command:

echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null | openssl x509 -noout -dates -subject -ext subjectAltName

Look for two things. First, the notAfter date. If it is in the past, the certificate is expired and must be renewed. Second, the subjectAltName list. If the certificate covers example.com but not www.example.com, visitors on the www version get a name mismatch error while the bare domain works fine. That split is the classic symptom of a name problem. On shared hosting with cPanel, AutoSSL normally renews certificates automatically, but it can fail silently when a DNS record points elsewhere or a domain validation file is blocked. Check the AutoSSL status in cPanel after any certificate error.

Use curl to see what the browser sees

When DNS and the certificate look fine, reproduce the visitor experience with curl and read the verbose output:

curl -v https://example.com 2>&1 | head -40

The handshake lines tell you whether the connection reached the right server, whether the certificate was accepted, and where the request actually landed. A redirect loop shows up as repeated 301 or 302 responses. A connection refused error means the web server or firewall is the problem, not DNS. A timeout after the handshake points at the application or the database. This single command narrows the fault to one layer in seconds, and it avoids the trap of debugging the wrong layer for an hour.

Check the chain, not just the certificate

A valid certificate can still fail if the intermediate chain is incomplete. Some browsers tolerate a missing intermediate and others do not, so the site works for you and breaks for some visitors. Test the full chain with an online checker such as SSL Labs, or verify locally:

openssl s_client -servername example.com -connect example.com:443 -showcerts 2>/dev/null | grep -c "BEGIN CERTIFICATE"

Expect at least two certificates in the output: your leaf certificate and at least one intermediate. If only one appears, the server is not sending the chain. On Apache or nginx this is a configuration issue in the certificate file. On cPanel, reinstalling the certificate through the SSL/TLS manager usually fixes it.

Keep a simple outage checklist

During an outage, stress makes you skip steps. I keep a short checklist that starts with these two checks, then moves to the server. It is the same order every time:

1. dig the domain and compare the IP
2. openssl s_client and check expiry plus names
3. curl -v to confirm what a visitor gets
4. Only then: server logs, disk space, services

For a fuller incident workflow, see my post on how I triage a production incident. The point of the checklist is not to be clever. It is to make the cheap checks automatic so you never spend an hour debugging an application that was never reached.

The takeaway

DNS and TLS are the most common silent causes of a site appearing dead while the server is healthy. Check resolution from the outside, check expiry and names, and reproduce the visitor experience with curl before you touch a log file. These three commands take about a minute and they either find the outage or rule out the front door entirely.

Muhammad Aqib ← ALL ARTICLES
KEEP EXPLORING

More ideas.
Better engineering.

Explore the journal ↗