IP, DNS & Routing
How a name like google.com turns into an IP address, and how packets find their way.
IP addresses
Every device on the Internet has an IP address. IPv4 addresses are 32 bits, written as four octets: 192.0.2.1. IPv6 addresses are 128 bits: 2001:0db8:85a3::8a2e:0370:7334. We're slowly migrating from v4 to v6 because v4's 4 billion addresses ran out years ago.
Public vs private
- Public — globally unique, routable on the open Internet.
- Private — reserved ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) used inside home/office networks. They reach the public Internet through Network Address Translation (NAT) at your router.
DNS — turning names into numbers
Humans remember 'google.com'; routers need '142.250.190.78'. DNS (Domain Name System) is a globally distributed database that translates names to addresses.
- Your computer asks a RESOLVER (often run by your ISP or 1.1.1.1).
- The resolver asks the ROOT servers (which know who runs .com).
- Then the .com servers (which know who runs google.com).
- Then google.com's authoritative servers (which know the actual IP).
- The resolver caches the answer (with a TTL) so subsequent queries are instant.
Routing
Once your packet has a destination IP, ROUTERS along the path read the IP header and forward the packet hop-by-hop. Each router has a routing table; for each destination, it knows the next hop. The Internet is just thousands of these routers, gossiping (via BGP) about which networks they can reach.