DNS¶
DNS (Domain Name System) translates domain names to IP addresses. It's a hierarchical, distributed system. Lookup flow: browser cache → OS cache → recursive resolver → root server → TLD server → authoritative server. Record types: A (domain → IPv4), AAAA (→ IPv6), CNAME (alias), MX (mail), NS (nameserver), TXT (metadata). TTL controls caching duration.
Key Concepts¶
Deep Dive: DNS Resolution Flow
Deep Dive: DNS Record Types
| Type | Purpose | Example |
|---|---|---|
| A | Domain → IPv4 | example.com → 93.184.216.34 |
| AAAA | Domain → IPv6 | example.com → 2001:db8::1 |
| CNAME | Alias → another domain | www.example.com → example.com |
| MX | Mail server | example.com → mail.example.com |
| NS | Authoritative nameserver | example.com → ns1.example.com |
| TXT | Text data (SPF, verification) | "v=spf1 include:..." |
Common Interview Questions
- How does DNS work?
- What is the difference between A and CNAME records?
- What is DNS caching? What is TTL?
- What happens if a DNS server is down?
- How does DNS load balancing work?