Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Networking Section

This section covers the Linux tools for working with networks: finding out what addresses your machine has, checking whether another host is reachable, downloading files over the web, translating domain names into IP addresses, and watching the traffic itself. Everything here ships with Linux by default or installs from any distribution’s package manager.

If you have never looked “under the hood” of your internet connection, this is the section that will. Each tool is introduced with a scenario first, then the commands you will actually type.

How the Pieces Fit Together

A network connection on Linux is built from a few layers, and each tool in this section works at one of them:

LayerWhat it isTools in this section
InterfaceThe hardware (or virtual) port your machine connects throughip, ifconfig
ReachabilityWhether another machine answers at allping, traceroute
Translating namesTurning example.com into an IP address and backdig, nslookup, host
Transferring dataActually moving files over HTTP, FTP, and friendscurl, wget
Sockets and trafficWhat connections and packets your machine has openss, netstat, tcpdump, nc

When something “isn’t working on the network”, these layers give you a checklist: check the interface (ip), check reachability (ping), check name resolution (dig), then check the connection itself (ss or tcpdump).

Tools in This Section

PageWhat it doesReach for it when
ipShow and configure interfaces, addresses, and routesYou need to know your own IP or fix a network interface
ifconfigThe older interface viewer/configuratorYou are on an old tutorial or legacy server that still uses it
pingSend test packets and measure the round tripYou want to know if a host is up and how fast it answers
curlTransfer data with URLs — HTTP, FTP, and dozens moreYou are calling an API or downloading from a script
wgetNon-interactive downloading, with resume and mirroringYou are grabbing whole files or directories
ssShow open sockets and listening portsYou want to know what is connected or listening right now
netstatThe older socket and routing statistics toolLegacy scripts and tutorials reference it
digQuery DNS records in detailYou are debugging why a name resolves (or doesn’t)
nslookupQuick interactive name lookupYou want a fast answer on any system
hostSimple DNS lookups with terse outputYou want the IP of a name in one short line
tracerouteShow every hop a packet takes to a destinationYou are debugging where the connection breaks
tcpdumpCapture and inspect raw network trafficYou need to see exactly what is on the wire
ncRead and write raw connections — the networking swiss army knifeYou are testing a port, or piping data between machines

A Worked Example: “The Website Is Down”

A realistic troubleshooting flow using this section’s tools, in order:

# 1. Is my own network up? Check my interface and address.
ip addr show

# 2. Can I reach a known-good host by name?
ping -c 3 example.com

# 3. Ping worked by name, but my target's name fails? Check DNS.
dig example.org

# 4. Name resolves, but the site still fails? Is the port open?
nc -zv example.org 443

# 5. Everything looks fine but data is missing? Ask the server directly.
curl -I https://example.org

Each step narrows the problem down. This exact sequence — interface, reachability, DNS, port, application — is how network engineers debug, and it is worth memorizing.

Why This Matters

  • Servers are accessed over networks — every tool in this section assumes you will eventually log into a remote machine and debug its connection from the shell.
  • Debugging is a layered process — knowing which tool answers which question (“is DNS broken or is the server down?”) saves hours.
  • These tools appear in scripts everywhere — curl and nc in particular show up in setup scripts, health checks, and CI pipelines that you will read and write.

The tools in this section get more useful the more you use them. Start with ip and ping to answer “what is my address and can I reach things?”, then move to curl, dig, and nc as you start building scripts and debugging real problems.