← Lessons

quiz vs the machine

Gold1400

Networking

The DNS Load Balancing

Spreading traffic by handing out different answers per query.

5 min read · core · beat Gold to climb

Balancing at the Name Layer

DNS can spread load before a connection even opens by returning different addresses for the same name. Because every client must look up the name first, the resolver becomes a natural place to steer traffic.

Round Robin

The simplest method is round robin, where a zone lists several A records and rotates their order on each response.

  • Clients usually try the first address returned.
  • Rotating the order spreads connections across the listed servers.
  • It needs no special hardware, only multiple records.

Weighted and Geographic Answers

Smarter authoritative servers can tailor the answer to the asker.

  • Weighted answers return a larger server more often to match its capacity.
  • Geographic steering returns an address near the resolver to cut latency.
  • Health aware servers drop addresses that fail health checks.

The Limits

DNS load balancing is coarse because caching hides clients behind a resolver, so the balancer sees resolvers rather than users. The time to live also delays how fast a failed server can be removed, which is why short timers are common here.

Key idea

DNS load balancing hands out different addresses per query through round robin, weights, or geographic steering, but caching and time to live make it coarse and slow to react.

Check yourself

Answer to earn rating on the learn ladder.

1. How does round robin DNS spread traffic?

2. Why is DNS load balancing considered coarse?