Network Troubleshooting Tools
A toolbox for diagnosing connectivity, routing, DNS, and port problems.
Theory
When a service is unreachable, work the layers bottom-up and isolate where it breaks before guessing:
- Reachability —
ping(is the host up and routable?) - Path —
traceroute/mtr(where does it stop?) - Name resolution —
dig/nslookup(does DNS resolve?) - Transport/app —
curl -v,nc,telnet(is the port open and answering?) - Local listeners —
ss -tlnp(is anything bound to the port here?)
Each tool answers one question. The discipline is to confirm each layer works before moving up, so you find the first broken link instead of chasing symptoms.
Real-World Example
ping -c 4 example.com # reachable? round-trip times
mtr example.com # live traceroute + loss per hop
dig +short example.com # does DNS resolve?
nc -zv example.com 443 # is port 443 open?
curl -v https://example.com # full app-level request/response
ss -tlnp # local listening sockets + PIDs
ip addr ; ip route # my addresses and routing table Hands-On Exercise
- Ping a host and a made-up name; explain the difference in the errors.
- Use
nc -zvto test whether a known port is open on a server. - Run
ss -tlnpand identify which process owns a listening port. - Given “ping works but the website won’t load”, list your next two checks.
Cheat Sheet▾
| Question | Tool |
|---|---|
| Is the host reachable? | ping |
| Where does the path break? | traceroute / mtr |
| Does DNS resolve? | dig / nslookup |
| Is the port open? | nc -zv host port |
| Does the app respond? | curl -v |
| What’s listening here? | ss -tlnp |
| My IP / routes? | ip addr / ip route |
Common Interview Questions▾
A service is unreachable — what's your approach?
Work the layers bottom-up: ping for reachability, traceroute/mtr for the path, dig for DNS, nc/curl for the port and app, and ss locally. Confirm each layer before moving up to isolate the first failure.
ping succeeds but curl to the site fails. What does that tell you?
IP-level connectivity is fine, so the issue is higher up — DNS, a closed/filtered port, a firewall, TLS, or the application itself.
Official Documentation
📝 My notes on this topic
Auto-saves as you type