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
| Problem | DNS Solution |
|---|---|
| IP addresses are hard to remember | Domain 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 other | Decentralized 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)
- User types
google.cominto the browser. - The browser has no idea what
google.commeans. - The browser sends a DNS query to a configured DNS resolver.
- The resolver searches its records (or queries upstream) for the domain’s IP.
- The resolver returns the IP address to the browser.
- 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.
Related Concepts
- DNS Record Types — A, CNAME, MX, NS, TXT, SRV
- DNS Caching — Browser, OS, router, ISP, and server-level caches
- DNS Resolution Flow — Step-by-step query walkthrough
- DNS Hierarchy and Root Servers — Root, TLD, and authoritative servers
- CoreDNS — Kubernetes cluster DNS
- Public DNS Resolvers — Cloudflare 1.1.1.1, Google 8.8.8.8