DNS (Domain Name System) translates human-readable domain names like google.com into IP addresses. It's the phone book of the internet and a key lever for global traffic routing.
DNS translates domain names (e.g., leetdesign.com) into IP addresses (e.g., 104.21.45.83) that computers use to locate each other on the internet. Without DNS, you'd need to memorize IP addresses to visit websites.
Browser → Recursive Resolver (ISP or 8.8.8.8)
→ Root Name Server (knows TLD servers)
→ TLD Name Server (.com, .org, etc.)
→ Authoritative Name Server (your DNS provider)
→ IP Address returned to browser
| Record | Purpose | Example |
|---|---|---|
| A | Maps domain → IPv4 address | leetdesign.com → 104.21.45.83 |
| AAAA | Maps domain → IPv6 address | leetdesign.com → 2606:... |
| CNAME | Alias one domain to another | www.example.com → example.com |
| MX | Mail server for a domain | example.com → mail.example.com |
| TXT | Arbitrary text (used for verification, SPF) | Domain ownership proofs |
| NS | Specifies the authoritative name servers | example.com → ns1.cloudflare.com |
TTL controls how long DNS responses are cached at each resolver. A low TTL (60 seconds) means changes propagate quickly but increase DNS query load. A high TTL (86400 = 24 hours) is efficient but means DNS changes take longer to propagate.
Strategy:
Return different IP addresses based on the user's geographic location. Users in Europe get routed to EU servers; users in Asia get routed to Asia-Pacific servers. This is how global applications achieve low latency.
Return multiple A records for the same domain. Clients round-robin across them. Simple but crude — doesn't health check or respond to actual server load.
Monitor origin servers and automatically update DNS to point to a backup server if the primary fails. Recovery depends on TTL (could take minutes to hours for changes to propagate).
Slowly shift traffic from old (blue) to new (green) infrastructure by updating DNS records, changing weights gradually.
If your DNS provider goes down, your entire service is unreachable — even if your servers are perfectly healthy. Use multiple DNS providers and DNS redundancy. Several major outages (Fastly 2021, Dyn 2016) have taken down large portions of the internet.