skipnothing/HTTP & Networking
UNIT 01

Names & Addresses

IPs, ports, sockets, and how a hostname becomes a packet destination

Before a request can travel, a name has to become a number, the hostname becomes an IP, the IP plus a port becomes a socket. This unit grounds the layer most developers skip past until something stops working.

Loading…
TOPICS
#1

IP Addresses

Classify any IPv4 or IPv6 address by its leading bits (private, loopback, link-local, documentation, public), read CIDR `/N` to predict host count, and compress an IPv6 address to canonical form with a single `::`.

Run `ifconfig` and one line reads `inet 192.168.1.42`, which looks like four small numbers with dots between them. It is really one 32-bit integer, and its leading bits alone already say whether it can leave your machine at all.

12 min
#2

Ports & Sockets

Name the four numbers that identify a TCP connection, predict whether two `bind()` calls collide before running them, and read a `TIME_WAIT` row in `ss` as an address still held after close.

`ss -tn` on a machine serving traffic prints dozens of rows, and every one shows `10.0.0.5:443` on the left with a different address on the right. One slot, dozens of live conversations, and the right column is why.

12 min
#3

DNS Resolution

Separate the stub's single query from the recursive's walk down the root, TLD, and authoritative chain, read a `dig +trace` block by block, and predict when a repeat lookup skips the walk from cache.

`dig example.com` prints one answer in a few milliseconds, but `dig +trace example.com` prints three screens of servers handing you off, each one saying `ask them instead` until the last one finally answers.

13 min
#4

DNS Records & TTL

Read a `dig` answer line as five fields, match A, AAAA, CNAME, MX, and TXT to the payload each carries, and predict how long a record change takes to clear every cache from the TTL already in flight.

`dig example.com` prints one line: a name, a couple of numbers, and an address. Change that address at the source and half the internet keeps handing out the old one for hours, each server on its own clock.

12 min
#5

Resolver Priority

Trace the `hosts:` line of `/etc/nsswitch.conf` to predict which source answers a name, distinguish an `/etc/hosts` override that `ping` honors from one `dig` ignores, and read the `[NOTFOUND=return]` bracket that keeps `.local` names off your ISP's resolver.

Add one line to a file on your disk and `ping app.example` answers with the address you picked. Run `dig app.example` right after and it ignores that line entirely, going straight to the network instead.

11 min
All units