Building Blocks

DNS

Understanding the Domain Name System and its role in distributed systems.

1 min readConcepts · System Design

What is DNS?

DNS (Domain Name System) is the phonebook of the internet. It translates human-readable domain names (like google.com) into IP addresses (like 142.250.185.78) that computers use to communicate.


How DNS Works


DNS Record Types

RecordPurposeExample
AMaps domain to IPv4example.com → 93.184.216.34
AAAAMaps domain to IPv6example.com → 2001:db8::1
CNAMEAlias to another domainwww.example.com → example.com
MXMail serverexample.com → mail.example.com
TXTText data (verification, SPF)"v=spf1 include:_spf.google.com"
NSNameserver delegationexample.com → ns1.example.com

DNS in System Design

Load Distribution

DNS can distribute traffic across multiple servers using Round-Robin:

Geographic Routing

Route users to nearest datacenter based on location.

TTL (Time To Live)

  • Low TTL (60s): Quick changes, more DNS queries
  • High TTL (86400s): Fewer queries, slower propagation

Interview Tips

  • Know the resolution process: Root → TLD → Authoritative
  • Understand record types: A, AAAA, CNAME, MX
  • TTL trade-offs: Low for flexibility, high for performance
  • DNS for load balancing: Round-robin, geographic routing

Finished reading?

Mark it done to track your progress in Concepts.