← All lessons
DNS, HTTP and other protocols · Lesson 7 of 7

Tools for finding problems

When "the internet is down", the layers tell you where to look. Work from the bottom up: is the device connected and does it have an address? Can it reach the router? Can it reach the internet by IP address? Do names work? Does the one site work?

ipconfig (Windows) or ip addr (Linux) shows your own IP address, mask and gateway. A 169.254 address means DHCP failed. ping sends a small ICMP echo and times the reply: ping 192.168.1.1 tests the router, ping 1.1.1.1 tests the internet without DNS. Some servers block ping, so no reply doesn't always mean down.

$ ping -c 3 1.1.1.1
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=11.8 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=57 time=12.1 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=57 time=11.6 ms

traceroute (tracert on Windows) lists every router on the way. It sends packets with a TTL of 1, then 2, then 3, and each router that drops one sends back an error that says who it is. Where the times jump or the replies stop shows where the trouble is.

nslookup quackgames.net (or dig) tests DNS on its own. If ping 1.1.1.1 works but names don't, it's DNS. curl -I https://quackgames.net fetches just the HTTP headers, so you can see the status code and redirects without a browser. Many problems also turn out to be the simplest layer: a loose cable, the wrong Wi-Fi, or airplane mode.

Practice

ping 1.1.1.1 works but ping quackgames.net says the name can't be found. What's broken?

More info

Quick reference

ipconfig / ip addrYour address, mask and gateway.
pingCan I reach it, and how fast?
traceroute / tracertEvery hop on the way.
nslookup / digTest DNS on its own.
curl -IJust the HTTP response headers.
Bottom upLink, address, router, internet, DNS, site.

The other networking courses