How DNS works
DNS turns names into IP addresses. Your resolver walks the tree - root, then the top-level domain, then the domain's own server - and caches every answer for its TTL.
Layer: Application (OSI layer 7) · Port: 53 · Transport: UDP (TCP for large answers) · Format: Binary questions + resource records · Standard: RFC 1034, RFC 1035
DNS packet flow
- DNS Client → DNS Resolver: Standard query A www.example.com
- DNS DNS Resolver → Root Server: Query A www.example.com (iterative)
- DNS Root Server → DNS Resolver: Referral: com. NS a.gtld-servers.net
- DNS DNS Resolver → .com TLD: Query A www.example.com
- DNS .com TLD → DNS Resolver: Referral: example.com. NS ns1.example.com
- DNS DNS Resolver → Authoritative: Query A www.example.com
- DNS Authoritative → DNS Resolver: Answer A 203.0.113.10 TTL 3600 (aa)
- DNS DNS Resolver → Client: Standard query response A 203.0.113.10
Other protocols: Ethernet · IP · IPv6 · TCP · UDP · ICMP · ARP · DHCP · BGP · NTP · IGMP