DNS Fundamentals

“DNS is the phonebook of the internet. You remember names; DNS remembers numbers.” — Day 30 CKA Video

What is DNS?

The Domain Name System (DNS) is a distributed, hierarchical naming system that translates human-readable domain names (like google.com) into machine-readable IP addresses (like 142.250.80.46).

Without DNS, every user would need to memorize the IP address of every website they visit.

Why We Need DNS

ProblemDNS Solution
IP addresses are hard to rememberDomain names are human-friendly
Server IPs change (migration, scaling, failover)Update the DNS record once; users stay unaffected
Billions of devices need to reach each otherDecentralized lookup infrastructure scales globally

The House Analogy

Imagine visiting a friend’s house:

  • House name: “Garg Awilla” — easy to say, but you can’t navigate to it.
  • Full address: Street, city, PIN code — precise, but hard to remember.

On the internet:

  • Domain name (google.com) = House name
  • IP address (1.2.3.4) = Full postal address

DNS bridges the two. Day 30 CKA Video

How DNS Works (High-Level)

  1. User types google.com into the browser.
  2. The browser has no idea what google.com means.
  3. The browser sends a DNS query to a configured DNS resolver.
  4. The resolver searches its records (or queries upstream) for the domain’s IP.
  5. The resolver returns the IP address to the browser.
  6. The browser opens a TCP connection to that IP and requests the webpage.
User → Browser → DNS Resolver → [Hierarchical Lookup] → IP Address → Browser → Web Server

The DNS Namespace

DNS is organized as a tree (inverted), with the root at the top:

          .           ← Root
         / \
       .com .dev      ← TLDs (Top-Level Domains)
       /     \
  google   piyushgarg  ← Second-Level Domains (registered)
     /         \
  www       www        ← Subdomains

Each level is managed by a different authority:

  • Root → managed by ICANN / IANA
  • TLD (.com, .dev) → managed by registry operators
  • Second-level (google.com) → managed by the domain owner / registrar

DNS is Decentralized by Design

A single central DNS server would be:

  • A single point of failure
  • Incapable of handling billions of global queries
  • A latency bottleneck for users far from the server

Instead, DNS uses a hierarchical, distributed architecture with caching at every layer.

Source