A website is not loading on your laptop. How would you troubleshoot it?
MediumConceptScenario Questions
Answer
Work up the layers from the bottom, testing one thing at a time, so that each successful check rules out a whole class of causes. The first check that fails points to the faulty layer.
- Link and IP configuration: confirm the cable or Wi-Fi connection, then run
ipconfig(Windows) orip addr(Linux). An address such as169.254.x.xmeans DHCP failed. - Reachability:
pingthe default gateway (for example192.168.1.1) to test the local network, thenping 8.8.8.8to test routing to the internet. - DNS: run
nslookup example.com. If IP addresses respond but names do not resolve, the DNS server setting is at fault. - Transport and application:
curl -v https://example.comshows whether TCP connects on port 443, whether TLS succeeds and which HTTP status returns, such as 503 from an overloaded server.
Example:
$ ping 192.168.1.1 replies -> the LAN and router are fine
$ ping 8.8.8.8 replies -> routing to the internet works
$ nslookup example.com timed out -> DNS is broken
The fault is DNS. Switching to a working resolver such as 1.1.1.1 fixes it, and it explains why the site opened by IP address but not by name.