DNS (Domain Name System) (DNS)
The internet's phone book—translates human-readable domain names (example.com) into IP addresses (93.184.216.34). Every CDN request starts with a DNS lookup.
Full Explanation
DNS is where every web request begins. Your browser asks "what's the IP for cdn.example.com?" and DNS resolves it. For CDNs, DNS is also a traffic steering tool—the CDN's authoritative DNS can return different IPs based on the user's location, server health, or load.
DNS resolution adds latency. A cold DNS lookup can take 20-120ms depending on how many nameservers need to be queried. That's why DNS TTLs matter—longer TTLs mean fewer lookups but slower failover. CDNs typically use short TTLs (30-300s) for their edge IPs to enable fast traffic shifting.
Modern DNS features like EDNS Client Subnet (ECS) let CDN nameservers see the user's approximate location (not just the resolver's location), enabling more accurate geo-routing. Without ECS, a user in Tokyo using Google DNS (8.8.8.8) might get routed to a US PoP because Google's resolver is in the US.
Examples
# Trace the full DNS resolution chain
$ dig +trace cdn.example.com
# Check which CDN edge you're hitting
$ dig +short cdn.example.com
104.16.132.229
# Check DNS response time
$ dig cdn.example.com | grep 'Query time'
;; Query time: 12 msec
# See EDNS Client Subnet in action
$ dig @8.8.8.8 +subnet=103.0.0.0/24 cdn.example.com
# Returns different IP than without subnet
Video Explanation
Frequently Asked Questions
The internet's phone book—translates human-readable domain names (example.com) into IP addresses (93.184.216.34). Every CDN request starts with a DNS lookup.
# Trace the full DNS resolution chain
$ dig +trace cdn.example.com
# Check which CDN edge you're hitting
$ dig +short cdn.example.com
104.16.132.229
# Check DNS response time
$ dig cdn.example.com | grep 'Query time'
;; Query time: 12 msec
# See EDNS Client Subnet in action
$ dig @8.8.8.8 +subnet=103.0.0.0/24 cdn.example.com
# Returns different IP than without subnet
Related CDN concepts include: