Interview Q&A / System Design

IntermediateQuick answer1 min readUpdated 3 Oct 2026

How does DNS-based global load balancing route users to the nearest data centre?

SHORT ANSWER

The DNS service answers with a different IP depending on where the user is, which server is healthy, or latency measurements. Users in Mumbai get the Mumbai address, users in London get London's.

Explain it simply

When your browser asks for api.example.com, DNS replies with an IP address. A smart DNS (GeoDNS or a global traffic manager) does not return the same answer to everyone.

It can choose the answer by:

  • Geography: the resolver's location maps to the nearest region.
  • Latency: it picks the region with the lowest measured response time.
  • Health: if a region fails health checks, its IP is dropped from answers.
  • Weights: send 10% of traffic to a new region for a gradual rollout.

Limits to mention:

  • DNS answers are cached for the TTL, so failover is not instant; keep TTLs short (30 to 60 seconds) for critical records.
  • DNS sees the resolver's location, not always the user's.
  • It balances between regions; inside each region a normal load balancer spreads traffic among servers.

Anycast is an alternative: the same IP is announced from many places and the network routes to the closest one.

Example

Domain: shop.example.in with servers in Mumbai and Frankfurt.

text
User in Pune      -> DNS returns 103.0.0.10 (Mumbai)
User in Berlin    -> DNS returns 85.0.0.20  (Frankfurt)
Mumbai fails check-> everyone gets 85.0.0.20 once cached answers expire (TTL 60 s)

What to say in the interview

"Global load balancing uses DNS that returns region-specific IPs based on geography, latency, health and weights. Failover speed is bounded by the TTL. Within a region, a regular load balancer takes over; anycast is another way to reach the nearest site."

#load-balancing#dns

Related questions

Practise more System Design questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open System Design quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.