Users cannot remember numerical IP addresses for every service they access. A human-readable naming system that scales globally is needed.
DNS translates domain names (www.example.com) to IP addresses using a hierarchical, distributed system of name servers with caching at every level.
- A user types a domain name into a browser.
- The browser checks its local cache, then the OS cache, then the ISP resolver.
- The recursive resolver queries the root name server for the TLD server.
- The TLD server directs to the authoritative name server for the domain.
- The authoritative server returns the IP address (A record) or other record type.
- Results are cached at each level for the duration of the TTL.
- Record types include A (address), CNAME (canonical name), MX (mail exchange), NS (name server).
- Hierarchical tree structure: root → TLD → authoritative
- Cached at multiple levels: browser, OS, ISP resolver
- TTL (Time To Live) controls how long entries are cached
- Supports weighted routing, latency-based routing, and geo-routing via managed DNS providers
- Managed DNS services: Route53, CloudFlare DNS, Google Cloud DNS
- Related: Push CDN — DNS routes users to the nearest CDN edge server
- Related: Pull CDN — DNS resolution directs users to the appropriate CDN endpoint
- Related: Layer 4 Load Balancing — DNS can distribute traffic across multiple server IPs
- Related: Active-Active Failover — DNS must be configured with all active server IPs
- DNS propagation delays mean changes to records take time (up to 48 hours for TTL expiration everywhere)
- DNS is vulnerable to cache poisoning attacks if DNSSEC is not implemented
- CNAME records cannot coexist with other record types at the same DNS node — use ALIAS or ANAME records instead