Networking & Traffic Management

DNS Resolution

Turning a hostname into an IP address walks a chain of caches and authoritative servers — and along the way, DNS itself becomes a crude but effective load-balancing and failover tool.
  • Resolution chain: browser cache → OS cache → recursive resolver (often the ISP or a public one like 8.8.8.8) → root servers → TLD servers → authoritative nameserver
  • TTL controls how long a record is cached — low TTL enables fast failover and traffic shifting, at the cost of more lookups hitting the authoritative server
  • DNS round-robin (returning multiple A records in rotation) gives coarse load distribution, but clients and resolvers cache results, so it is not real-time load balancing
  • GeoDNS / latency-based routing returns a different IP depending on the resolver's location — often the very first routing decision in a global architecture
  • DNS runs mostly over UDP (port 53) with TCP fallback for large responses, and is itself an eventually-consistent, cache-heavy system — propagation after a change is not instant
The DNS resolution chain
Every hop after the first is cached at the resolver for the TTL — repeat lookups from any client behind that resolver are free until it expires
Common DNS record types
RecordPurpose
A / AAAAHostname → IPv4 / IPv6 address
CNAMEAlias — one hostname points to another hostname
NSDelegates a zone to a set of authoritative nameservers
MXMail server for the domain
TXTArbitrary text — domain verification, SPF/DKIM policy
Sources
  • System Design Interview – An Insider's GuideCh. 1 — DNS
  • System Design: The Big Archive (2024 ed.)Networking — How DNS Works