What is the Domain Name System (DNS) and what function does it serve?
DNS is the internet's phone book: a distributed, hierarchical system that translates human-friendly domain names into the numeric IP addresses computers actually use.
People remember google.com; computers route traffic to numbers like 145.45.89.10. DNS is the lookup service that bridges the two. Originally each computer kept a single shared text file named hosts listing every name-to-address mapping — which obviously could not scale to a global internet. Today DNS is a decentralized network of name servers, where each server is responsible for only a slice of all domains.
When a name server is asked about a domain, it answers in one of three ways:
- The correct IP address, if it knows it (it is responsible, or has it cached).
- A referral — "I don't know, but ask that server, which is closer to the answer."
- Doesn't exist — the domain is unknown (an NXDOMAIN response).
Why decentralized? Three big wins: fault tolerance (no single server can take the whole system down), scalability (it copes with billions of domains), and local control (an organization administers its own names).
Go deeper:
Domain Name System (Wikipedia) — the hierarchy, zones and iterative-resolution diagrams that make the "distributed phone book" picture concrete.