DNS-Based Load Balancing
What you'll learn: How DNS can distribute traffic across multiple servers before requests even reach a traditional load balancer.
The Core Idea
DNS-based load balancing uses the Domain Name System itself to distribute incoming traffic. When a user's device asks "What's the IP address for example.com?", the DNS server can respond with different IP addresses for different users. This happens before any dedicated load balancer gets involved—it's traffic distribution at the naming layer.
Think of it like asking for directions to "Joe's Pizza." Depending on where you ask from, you might be told different addresses—one on the east side, one on the west—so customers naturally spread out across locations.
DNS Round-Robin
The simplest approach is DNS round-robin: the DNS server has multiple IP addresses registered for one domain name and rotates through them in order. User A gets IP address 1, User B gets IP address 2, User C gets IP address 3, then it loops back. Each IP might point to a different data center or server cluster.
Geographic Routing
A smarter variant is geographic routing (also called geo-DNS). The DNS server checks where the request is coming from and returns an IP address for the nearest server. A user in Europe gets routed to European servers; a user in Asia gets Asian servers. This reduces latency and can help with data compliance requirements.
Limitations
DNS-based load balancing is primitive. DNS responses are cached by browsers and ISPs, sometimes for hours, so you can't quickly react to server failures. It also can't check server health or current load—it just distributes blindly based on configured rules.
Key Takeaway: DNS-based load balancing distributes traffic by returning different IP addresses to different users, using techniques like round-robin or geographic routing, but lacks the real-time awareness of dedicated load balancers.