Back to the map

Module 03 · Load balancing · Lesson 4 of 5

DNS load balancing

Using DNS answers to spread traffic across regions and balancers: round-robin records, weighted and latency-based routing, health-checked failover, and why TTLs and resolver caching make DNS a coarse, slow-moving balancer.

CoreShould-knowMid 9 min Updated Nov 2026

Why it matters

A load balancer has one address, and that address lives in one place. To spread traffic across regions, or across several independent balancers, the decision has to be made before the client connects, at the point where it looks up the name. That is DNS load balancing: the only balancing layer that works across the whole planet, and the one with the least control over what clients actually do.

The idea

The authoritative DNS server for your name answers each lookup with an address chosen by a policy, so different clients are steered to different endpoints.

PolicyAnswers withGood forLimit
Round robinA rotating order of several addressesCrude spreading across a few balancersClients and resolvers cache; distribution is uneven
WeightedAddresses in proportion to weightsCanary regions, gradual migrationsGranularity bounded by cached answers
Latency-basedThe region with lowest measured latency to the resolverMulti-region user experienceMeasures the resolver, not the user
GeolocationThe region mapped to the resolver's locationData residency, language, complianceResolver location can differ from the user's
FailoverPrimary while healthy, secondary otherwiseActive-passive regionsHealth check and TTL set the failover time

Health-checked records combine with any policy: the provider probes each endpoint and stops returning addresses that fail. Many providers bundle these policies as global server load balancing or "traffic management".

Resolver, EUResolver, USapi.example.com?api.example.com?Authoritative DNSlatency policyeu addressus addressEU balancer→ EU poolUS balancer→ US pool
Two resolvers ask for the same name and get different answers. Each region then balances locally with a normal load balancer.

Why it is coarse

DNS was designed as a cache, and caches resist change. Resolvers hold answers for the TTL, some longer; browsers and operating systems cache addresses themselves; a single corporate resolver may front a hundred thousand users, so one answer steers all of them. The provider also sees the resolver's address, not the user's, which is why latency and geo policies are approximate (the EDNS client-subnet extension narrows this, when resolvers support it). DNS can therefore shift traffic in minutes and in large lumps, which is fine for regions and useless for per-request balancing.

Where it fits

Use DNS to choose a region or an entry point, then a real load balancer to choose a server. Keep TTLs short on these records (30 to 60 seconds) so failover and weight changes take effect quickly, and accept that a slice of traffic will lag. For the hardest cases, anycast (next lesson) moves the region decision from DNS into the network itself.

Trade-offs

DNS balancing is global and cheap and works with any client, but it is approximate, slow to react and blind to server load. Short TTLs improve agility and raise lookup volume. Geo policies help compliance and can mis-route users on VPNs or distant resolvers. The failure mode to name is split traffic during a failover: for up to a TTL (or longer), some clients keep arriving at the region you are trying to drain, so that region must keep serving or redirecting.

In an interview

Introduce it exactly when regions appear: "Each region has its own load balancer; latency-based DNS with a 60-second TTL and health checks sends users to the nearest healthy region. Failover between regions therefore takes about a minute, and the failed region's balancer stays up to redirect stragglers." Saying the limit yourself prevents the interviewer from having to.

Check yourself

A team uses DNS round robin across three application servers as its only load balancer. One server crashes. What do users experience, and why does a dedicated load balancer behave differently?

DNS load balancing · Backplane