Course contents · Lesson 22 of 22

Capstone: A Network Troubleshooting Checklist

Troubleshooting Toolkit · Lesson 22 of 22 · 11 min Hands-on

A message lands at 9:40: "the shop site is down." It could be Wi-Fi, DNS, a firewall, a certificate or the app, and guessing wastes the first minutes. This capstone turns lessons 19 to 21 into a network troubleshooting checklist: five steps in a fixed order, each testing one layer, so the first step that fails tells you where the fault is.

Work in order, starting with the symptom

Opening a web page climbs the steps from lesson 10: your network, DNS, a TCP connection to the port, TLS, then HTTP. Each step needs the ones before it. If your Wi-Fi is down, DNS fails and curl fails too, so starting at DNS would blame the wrong layer.

Working upwards, the first failure is the real fault and later ones are its side effects. In the flowchart, each question is one quick command: a yes clears that layer, and the first no names the one to fix.

Flowchart. Start: write down the symptom. Question 1, can you ping 1.1.1.1? No means your network or ISP: ping the gateway, check the Wi-Fi or cable. Question 2, does the name resolve, does dig +short NAME give the right IP? No means DNS: the record is missing or wrong, so read the status and ask another resolver. Question 3, does the port connect, with no curl error 7 or 28? No: refused means nothing is listening, timed out means a firewall or the path. Question 4, is TLS OK, with no curl error 60 or 35? No means the certificate was rejected: read curl's reason and check the dates. Question 5, does HTTP answer 200? No means the application, and the network is fine: 4xx fix the request, 5xx the server. All yes: the network is fine, so write down what you checked and found
Each yes clears one layer, so the first no is the fault.

Step 1 needs no command: write down the symptom before you change anything. Four questions narrow it fast:

  • Who is affected? Only you, your whole network, or every user? A site that works on mobile data points at your side.
  • Which site or port? One site or all of them; the web page on port 443, or SSH on port 22 too.
  • Since when? An exact time, and whether it broke at once or slowly.
  • What changed? A deploy, a DNS edit, a certificate renewal, a firewall rule, a new VPN. Outages often follow a change.

Step 2: are you online?

Start at your own end, as in lesson 19: ping your default gateway, usually your router, then a public address. ip route (Linux), netstat -rn (macOS) or route print (Windows) shows the gateway, as in lesson 12:

ping -c 4 192.168.1.1
ping -c 4 1.1.1.1

The gateway address is an example. 1.1.1.1, Cloudflare's public DNS resolver, answers ping and needs no name lookup. Replies from both mean your device, local network and provider's link all work.

No reply from the gateway points at your device, Wi-Fi or cable. A gateway that answers while 1.1.1.1 does not points beyond your router: your provider, or a network that blocks ping, so try 8.8.8.8 too before you blame the provider.

Step 3: does DNS give the right address?

Next, check that the name turns into the right IP address, with dig from lesson 20. Ask your usual resolver, then another one, here Cloudflare's:

dig +short shop.example.com
dig +short shop.example.com @1.1.1.1

Both should print the address the owner publishes, which the domain's own name server confirms. If the resolvers disagree, one is usually serving an old copy until its TTL runs out. If neither prints anything, run plain dig shop.example.com and read the status.

NXDOMAIN means the name or its record is missing; SERVFAIL means the resolver could not get an answer. A private name, known only to your company's DNS servers, gets NXDOMAIN from public resolvers, so compare two internal servers instead.

Step 4: can you reach the host and its port?

Now test the path to the host and its port: ping it, trace the path if it is silent, then let curl try the port. --connect-timeout 5, from lesson 13, gives up after 5 seconds of trying to connect:

ping -c 4 shop.example.com
traceroute shop.example.com
curl -v --connect-timeout 5 https://shop.example.com

Many servers ignore ping, so silence alone proves nothing. The trace shows how far packets get: one that runs into stars just before the site often means a firewall in front of it.

Then read how curl fails. curl: (7) Failed to connect to shop.example.com port 443 after 3 ms: Could not connect to server (the milliseconds vary, and curl before version 8.9.0 says Couldn't, as in lesson 13), arriving at once, means the host answered "nothing listens here": start or fix the service. A curl: (28) timeout after the 5 seconds means no answer at all, usually a firewall dropping the packets, or a broken path.

Step 5: TLS, HTTP, then write it down

If curl reaches the server but stops with curl: (60) SSL certificate problem:, TLS failed, and the words after the colon give the reason, such as certificate has expired. To see the dates, use lesson 18's command:

openssl s_client -connect shop.example.com:443 -servername shop.example.com </dev/null 2>/dev/null | openssl x509 -noout -dates

It prints a notBefore= and a notAfter= line. A notAfter date in the past means the certificate expired and must be renewed. Check your own clock too: a device set to the wrong date rejects good certificates.

Once TLS works, ask for the status code and the total time with curl's -w from lesson 21:

curl -s -o /dev/null -w '%{http_code} %{time_total}\n' https://shop.example.com

A line such as 200 0.184023 (illustrative) means the site answered OK in 0.18 seconds. A 4xx means the request is wrong, a 5xx that the server failed. Either way DNS, the connection and TLS worked, so look at the application.

The table maps common messages to a layer and a first command.

Table with three columns: symptom, probable layer, first command. NAME is the site's host name and GATEWAY your router. Nothing loads and 1.1.1.1 gets no reply: your network, ping -c 4 GATEWAY. Could not resolve host, or Name or service not known: DNS, dig NAME. Works for others, not for you: your resolver, dig +short NAME @1.1.1.1. Connection refused, curl error 7: the port, no service, ss -tln on the server. Connection timed out, curl error 28: firewall or path, traceroute NAME. SSL certificate problem, curl error 60: TLS certificate, openssl s_client -connect NAME:443 piped into openssl x509 -noout -dates. Slow or stalling pages: path or server, ping -c 20 NAME for loss and jitter and curl -w timings. HTTP 500, 502 or 503: application, curl -i https://NAME, then the server's logs. A note says to copy the message exactly, because it names the layer
The exact error message usually names the layer before you run anything.

ss -tln, run on the server itself, lists the TCP ports that programs listen on. Last, write down what you found: the symptom, each check with its result, the exact error, the layer and the fix. Such notes speed up the next incident and feed a blameless postmortem. For example:

09:40  shop.example.com down for every user
Online: gateway and 1.1.1.1 reply
DNS:    both resolvers give 203.0.113.7
Port:   443 connects
TLS:    curl: (60) SSL certificate problem: certificate has expired
Layer:  TLS. Fix: renew it, then automate renewal

The one-page version lists every command in order.

One-page network troubleshooting checklist: work top to bottom and stop at the first failure. Step 1, define the symptom before you type a command: who is affected, which site or port, since when, what changed. Step 2, are you online: ip route finds your gateway, then ping -c 4 GATEWAY and ping -c 4 1.1.1.1. Step 3, does DNS give the right IP: dig +short NAME and dig +short NAME @1.1.1.1. Step 4, do the path and port work: ping -c 4 NAME, traceroute NAME, curl -v https://NAME; refused and timed out differ. Step 5, are TLS and HTTP OK: openssl s_client -connect NAME:443 </dev/null piped into openssl x509 -noout -dates, and curl -s -o /dev/null -w with http_code and time_total. Footer: write down the first failure, word for word
Five steps, one layer each, from your own device up to the application.

Check yourself

dig +short gives the right address, but curl stops with curl: (60) SSL certificate problem: certificate has expired. Should you check the firewall?

No. curl reached the TLS handshake, so DNS, the path and the port all work; renew the certificate.

Your Wi-Fi drops. You run dig first, it times out, and you report a DNS outage. What did skipping step 2 cost you?

The real fault. With no network, every later check fails too, so DNS was only a side effect; pinging the gateway would have shown the dead link in seconds.

ping shop.example.com gets no replies, yet curl connects and gets a 503. Where is the fault?

In the application. A 503 is the server's own reply, so DNS, the path, the port and TLS work; the host just ignores ping.