System Atlas
the atlas
NET · Networking8 minApplied

Network debugging commands every engineer should know

A toolkit that walks a broken connection from your machine out to the server.

the gist

When something 'can't connect', a handful of commands isolate exactly where it breaks. ping checks reachability, traceroute maps the path, dig/nslookup test DNS, ss/netstat show local sockets, ifconfig/ip inspect your own interface, curl and telnet/nc probe the actual service, and tcpdump captures the raw packets. Knowing which one answers which question is the skill.

ANALOGY // Debugging a network is like tracing undelivered mail: ping confirms the address answers the door, traceroute shows which post offices it passed, dig checks the address book, and tcpdump is opening the mailbag to read what was actually sent.
living diagram01 / 07
Each command probes a different point along the connection
01
ping
is the host reachable? (ICMP)
02
traceroute / tracert
which hop stalls?
03
nslookup / dig
does the name resolve?
04
netstat / ss
local sockets & ports
05
ifconfig / ip
my interface & routes
06
curl / wget · telnet / nc
does the service answer?
07
tcpdump
raw packets on the wire
01

ping — reachability

ping is the first thing to try: it sends ICMP echo requests to a host and waits for replies, telling you whether the target is reachable and how long the round trip takes. Success means basic connectivity and DNS both work; timeouts suggest the host is down, blocking ICMP, or unreachable. It answers the most fundamental question — is anything there at all?

02

traceroute / tracert

When ping fails or is slow, traceroute reveals the path packets take, listing every router hop between you and the destination with the latency to each. By seeing where the trail stops or where latency spikes, you can tell whether the problem is on your network, your ISP, or further out. It turns 'it's slow somewhere' into a specific hop.

03

nslookup / dig

If a name won't connect but its IP does, DNS is the suspect. nslookup and the more detailed dig query DNS servers directly, showing what IP a domain resolves to and letting you interrogate specific record types and resolvers. This isolates 'the site is down' from 'the site's name isn't resolving,' which are completely different fixes.

04

netstat / ss

To see what is happening on your own machine, netstat and its faster modern replacement ss list open sockets, listening ports and active connections. You can confirm your server is actually listening on the expected port, spot unexpected connections, or find what is occupying a port. It answers questions about the local end of the conversation.

05

ifconfig / ip

Before blaming the network, check your own interface. ifconfig (older) and ip (modern Linux) show your assigned IP addresses, subnet masks, interface state and routing. A missing address, a wrong subnet or a down interface explains a surprising number of 'no internet' problems right at the source.

06

curl / wget & telnet / nc

To test the service itself, curl (and wget) make real HTTP requests, showing the status code, headers and body so you see exactly how the server responds. When you need to check a raw port rather than HTTP, telnet or netcat (nc) attempt a plain TCP connection to a host and port, proving whether the port is open and something is listening.

07

tcpdump

When higher-level tools disagree with reality, tcpdump captures the actual packets crossing an interface, letting you watch the raw traffic — SYNs, retransmits, resets, DNS queries — as it happens. It is the ground truth: if a packet is or isn't on the wire, tcpdump shows it. It is the deepest, most powerful tool and the last stop when nothing else explains the failure.

the full picture
01

Debugging as isolation

Every network problem sounds the same when reported — "it's not working," "the site won't load," "the API times out" — and the entire skill of debugging is turning that vague symptom into a precise location. A request has to travel a long chain: out of your machine's interface, through your local network, resolved from a name to an address, across the internet's routers, to a server that is listening on a port and willing to answer. A failure lives at exactly one point in that chain, and these commands exist to test each point in turn.

The productive mindset is bisection: don't guess, probe. Start close to your machine and work outward, or start at the layer you most suspect. Each command answers a yes/no question, and the sequence of answers narrows the fault from "the internet is broken" down to "DNS is returning a stale record" or "the backend isn't listening on port 443." Master engineers aren't memorizing flags; they know which tool answers which question.

02

Reachability and path — ping and traceroute

The first question is always the simplest: is the target even reachable? `ping` sends ICMP echo-request packets and measures the round-trip time of the replies. A clean response tells you connectivity and DNS both work and shows the latency; consistent timeouts mean the host is down, unreachable, or silently dropping ICMP (some servers block it, so a failed ping isn't always fatal).

When ping fails or the latency looks wrong, `traceroute` (called `tracert` on Windows) shows the *path*. It cleverly sends packets with increasing TTL values so each router along the way reports itself, producing a hop-by-hop list from you to the destination with the latency at each step. This is invaluable for locating *where* things break: if the trail dies three hops out at your ISP, the problem isn't your code, and if latency suddenly jumps at one hop, you've found the congested link. Together these two convert "somewhere it's slow" into a specific place.

03

Names and the local machine — dig, ss, and ip

A huge share of "outages" are really name-resolution failures, so DNS gets its own tools. `nslookup` and the richer `dig` query DNS servers directly and print what a domain resolves to, which record types exist, and which resolver answered. If dig example.com returns the wrong IP or nothing, you've isolated the fault to DNS — a completely different fix from a dead server. You can even point them at a specific resolver to compare answers.

Two commands turn the lens onto your own host. `netstat` and its faster modern successor `ss` list sockets: what's listening, on which ports, and which connections are established. This confirms whether your server actually bound to port 8080, or reveals a mystery process squatting on a port. `ifconfig` (older) and `ip` (the modern Linux tool, as in ip addr and ip route) show your interfaces — assigned addresses, subnet masks, link state and routing table. A down interface, a missing IP, or a wrong default route explains an astonishing number of problems right at the source, before any packet ever leaves the building.

04

The service and the wire — curl, netcat, tcpdump

Once you know packets can reach the host, you test the *service*. `curl` (and `wget`) make real HTTP(S) requests and, with a flag like -v, show the full story: the status code, response headers, redirects, and body. This distinguishes "the server is unreachable" from "the server returns 500" from "it redirects in a loop" — each a different bug. When the issue is lower than HTTP, `telnet host port` or the more capable `nc` (netcat) simply try to open a raw TCP connection to a specific port. If nc -zv host 443 connects, the port is open and something is listening; if it hangs or refuses, you've found a firewall or a dead service.

When every higher-level tool leaves you confused, `tcpdump` is the final authority. It captures the actual packets crossing an interface, so you can watch SYNs go out, see whether SYN-ACKs come back, catch TCP resets, spot retransmissions, or read the DNS queries themselves. It doesn't interpret intent — it shows the literal truth on the wire — which is exactly why it settles arguments no other tool can.

05

Putting the toolkit together

The power of these commands is in the *sequence*, not any one of them. A typical investigation flows outward: check your own interface with ip addr, confirm the name resolves with dig, verify reachability with ping, map the path with traceroute, probe the port with nc, test the service with curl, and if the story still doesn't add up, drop to tcpdump to see the packets themselves. Each step either clears a layer or catches the fault, so you rarely need to run all of them — the first failing check usually points straight at the cause.

A few practical notes make them more effective. ICMP is sometimes blocked, so treat a failed ping as a hint, not a verdict. Prefer the modern tools where you can — ss over netstat, ip over ifconfig, dig over nslookup — since they're faster and more detailed. And remember that packet capture with tcpdump may need elevated privileges and can produce a firehose of data, so filter it (by host, port, or protocol). Internalizing this toolkit is what separates guessing from diagnosing: you stop asking "is the network broken?" and start asking "which link in the chain broke, and how do I prove it?"

what to remember
01

ping — is the host reachable at all, and what's the round-trip latency? (ICMP echo).

02

traceroute / tracert — which hops does traffic pass through, and where does it stall?

03

nslookup / dig — does the domain resolve to the right IP? (DNS diagnosis).

04

netstat / ss — what sockets, ports and connections are open on this machine?

05

curl / wget — does the actual HTTP service respond, with what status and headers?

06

telnet / nc — can I open a raw TCP connection to a specific host and port?

07

ifconfig / ip and tcpdump — inspect local interface config, and capture raw packets to see the truth on the wire.

check yourself

Quick quiz

Q1

A domain won't load but its raw IP does. Which tool diagnoses this?

Q2

What does tcpdump give you that curl or ping cannot?

follow the thread