Course contentsShow
← System Design
Lesson 180 of 1,9195. Content Delivery NetworksFree lesson

DNS-Based Request Routing

How CDNs use GeoDNS and intelligent DNS routing to direct users to the optimal edge server based on location and health.

DNS-Based Request Routing

You'll learn: How CDNs use intelligent DNS systems to automatically direct users to the fastest, healthiest edge server based on their location and server status.

What Is DNS-Based Request Routing?

When you request content from a CDN, you don't just get sent to any edge server—the CDN uses DNS-based request routing to intelligently choose the best server for you. Instead of returning a single static IP address, the CDN's authoritative DNS server analyzes your request and returns the IP of the optimal edge server.

How GeoDNS Works

GeoDNS is geography-aware DNS routing. When your DNS query arrives, the CDN's DNS resolver examines your IP address (or your DNS resolver's location) to determine where you are geographically. It then responds with the IP address of the nearest PoP (Point of Presence).

Think of it like calling a customer service hotline that automatically routes you to the closest call center based on your area code—except it happens at the DNS level, before any content is transferred.

Health-Aware DNS Routing

CDNs don't just route by location—they also monitor edge server health. If the nearest PoP is overloaded or experiencing issues, the DNS server can redirect you to the next-best alternative. This combines geographic proximity with active health checks (which you learned earlier) to ensure requests only go to healthy, available servers.

Why This Matters

DNS-based routing is the first decision point in the CDN request flow. Before a single byte of content moves, the DNS layer has already optimized which server will handle your request. This routing happens in milliseconds and is transparent to the user.

Key Takeaway:
CDNs use GeoDNS and health-aware DNS routing to return the IP of the optimal edge server—closest and healthiest—before the content request even begins.