Course contentsShow
← System Design
Lesson 500 of 1,91914. CAP TheoremFree lesson

DNS Systems (AP)

Why DNS prioritizes availability and accepts eventual consistency for global name resolution.

DNS Systems (AP)

What You'll Learn

You'll discover why the Domain Name System (DNS) is designed as an AP system that prioritizes availability over strict consistency when resolving domain names across the global internet.

Why DNS Chooses Availability

DNS translates human-readable domain names (like example.com) into IP addresses that computers use to communicate. With billions of queries happening every second worldwide, DNS must always respond to keep the internet functioning.

The DNS Tradeoff

DNS explicitly chooses availability over immediate consistency:

  • Always available: DNS servers respond to queries even if they haven't received the latest updates yet
  • Eventual consistency: When you update a DNS record, it gradually propagates through caching layers worldwide over minutes or hours
  • Partition tolerance: Regional DNS servers continue operating independently even when network links fail between continents

Why This Makes Sense

Imagine if DNS required consistency like a bank account. Every domain lookup would need to confirm with authoritative servers globally before responding. The internet would grind to a halt with millisecond delays becoming multi-second waits.

Instead, DNS uses aggressive caching with TTL (Time-To-Live) values. When you update a DNS record, different users might see the old IP address for hours until their local cache expires. This temporary inconsistency is acceptable because:

  • Stale DNS records rarely cause serious problems
  • The alternative (unavailable DNS) breaks the entire internet
  • Most changes aren't time-critical emergencies

During network partitions, regional DNS resolvers keep serving cached entries rather than failing. Users get slightly outdated answers, but websites remain reachable.

Key Takeaway: DNS prioritizes availability to keep the internet running smoothly, accepting that DNS record updates propagate gradually rather than instantly—a perfect example of choosing AP over CP when temporary inconsistency is tolerable but unavailability is catastrophic.