4. DNS
1
The picture to keep in your head2
4.1 Why do we need names at all?3
4.2 What are the parts of a domain name?4
4.3 What happens, step by step, when a name is looked up?5
4.4 What kinds of DNS records are there?6
4.5 What is a TTL, and why does DNS cache so much?7
4.6 How can DNS spread users across servers or send them to the nearest one?8
4.7 Why do DNS changes "take time to propagate"?9
4.8 What happens when DNS fails?10
Memory card and where the analogy breaks11
Practice: five levels12
Interview questions13
Solutions14
Sources15
Code lab4. DNS
Sources
3 min read+10 XP
Source notes
- DNS concepts, record format, label and name length limits, UDP and TCP use: RFC 1034 and RFC 1035. DNS over TCP requirements: RFC 7766. Clarifications on CNAME (no other data at a CNAME name): RFC 2181 and RFC 1034.
- Negative caching (NXDOMAIN): RFC 2308. EDNS Client Subnet: RFC 7871. DNS over TLS: RFC 7858. DNS over HTTPS: RFC 8484.
- IPv6 addresses are 128 bits: RFC 8200. Documentation address ranges (203.0.113.0/24, 198.51.100.0/24, 2001:db8::/32): RFC 5737 and RFC 3849.
- Dyn, 21 October 2016: Dyn's analysis (Scott Hilton, Dyn blog, 26 October 2016) reported a DDoS from the Mirai botnet against its managed DNS; widely reported effects on many major sites. See also the summary at https://en.wikipedia.org/wiki/DDoS_attacks_on_Dyn
- Facebook, 4 October 2021: "More details about the October 4 outage", Engineering at Meta, 5 October 2021, https://engineering.fb.com/2021/10/05/networking-traffic/outage-details/
- ALIAS / ANAME / "CNAME flattening" are provider features, not part of the DNS standard.
- Level 2 numbers (10,000 resolvers, 10 ms and 30 ms hops) are assumptions; arithmetic computed 2026-10-05.
- Level 3 and Level 4 code: tested 2026-10-05 (
code/ch04_dns.py, all checks pass).