DNS Deep Dive
The Postal Directory of Networking
In the Indian Postal System, you don’t memorize every house number or PIN code. Instead, you rely on postal directories that map names and areas to their correct addresses.
Networking works the same way. When you type google.com, your computer doesn’t know its IP address directly. It asks the Domain Name System (DNS) - the internet’s postal directory to resolve the human‑friendly name into a machine‑friendly IP address.
Core Concepts
- DNS Basics
- DNS = Domain Name System.
- Converts domain names (like google.com) into IP addresses (like 142.250.182.14).
- Like looking up a person’s name in the postal directory to find their PIN code.
- DNS Hierarchy
- Root Servers → The supreme directory (like India Post HQ).
- Top-Level Domains (TLDs) → .com, .org, .in (like state‑level postal directories).
- Authoritative Servers → Hold actual records (like district post offices).
- Recursive Resolvers → Your ISP’s DNS server that queries on your behalf (like your local post office clerk).
- DNS Records
- A Record → Maps domain to IPv4 address.
- AAAA Record → Maps domain to IPv6 address.
- CNAME Record → Alias for another domain.
- MX Record → Mail server info (like postal sorting centers for letters).
- NS Record → Points to authoritative name servers.
- Caching
- DNS responses are cached to speed up future lookups.
- Like keeping a local copy of the postal directory at your post office.
- Common Issues
- DNS Propagation Delay → Like updating a new PIN code across all postal directories.
- DNS Spoofing/Poisoning → Fake entries misdirect packets, like a fraudulent postal directory.
Hands‑On Exercise
- Change DNS Server
- Set DNS to
8.8.8.8(Google) or1.1.1.1(Cloudflare). - Like choosing a faster, more reliable postal directory.
- Set DNS to
Check DNS Cache (Linux)
systemd-resolve --statistics
Displays cached entries like your local post office’s mini directory.
DNS Lookup
nslookup google.com
dig google.com
Observe how DNS resolves the domain into an IP address.
Real‑World Relevance
- Web Browsing: Every site visit starts with DNS resolution.
- DevOps: CI/CD pipelines often fail due to DNS misconfigurations.
- Cloud: Services like Route 53 (AWS), Cloud DNS (GCP), and Azure DNS manage global directories.
- Security: DNS filtering blocks malicious domains, like postal checks preventing fake addresses.
The Hackers Notebook
DNS is the postal directory of the internet. It maps human‑friendly names to IP addresses, organizes them hierarchically, caches results for speed, and ensures packets reach the right destination just like postal directories guiding letters across India.
