Computer Networks20 min readBeginner

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.

DNS lookup — how google.com becomes an IP
Hierarchical: root → TLD → authoritative. Resolver caches the answer.
🖥️ YoubrowserResolver1.1.1.1 / ISP. (root)13 root servers.com TLDVerisigngoogle.comauthoritative📍 142.250.x.xthe actual server
Resolver cache: empty
Browser needs to resolve google.com
  • 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.

💡 Tip
Run `traceroute google.com` (or `tracert` on Windows). You'll see every router your packet visits between you and Google. Often 10-20 hops; cross-continental traffic is roughly 150ms even at the speed of light.