← Lessons

quiz vs the machine

Gold1360

Networking

DNS Load Balancing, Deep

Spreading traffic by returning multiple or rotating addresses from the resolver.

5 min read · core · beat Gold to climb

Balancing before the connection

DNS load balancing distributes clients across servers at name resolution time. When a client asks for a host, the resolver returns one or more addresses, and the choice of which spreads load.

Common techniques

  • Multiple A records: return several IPs; clients typically try the first, and resolvers may rotate the order.
  • Round robin DNS: the authoritative server rotates the record order per query so different clients get different first choices.
  • Geo or latency aware DNS: return the address of the nearest or healthiest site.

Strengths

  • No extra hop or hardware in the data path.
  • Works for any protocol since it acts before the connection.
  • Naturally spreads clients across many addresses.

Weaknesses

DNS was not built as a precise balancer.

  • Caching and TTL: resolvers and clients cache answers, so a server cannot be removed instantly. Low TTL helps but raises query load.
  • No real load awareness by default; rotation is blind.
  • Client behavior varies: some clients ignore record order or pin to one address.

These limits make DNS balancing a coarse first layer, usually paired with real L4 or L7 balancers behind each address.

Key idea

DNS load balancing spreads clients by returning multiple or rotating addresses at resolution time, but caching, TTL, and blind rotation make it a coarse layer best paired with real balancers.

Check yourself

Answer to earn rating on the learn ladder.

1. Round robin DNS spreads load by:

2. Why is removing a server from DNS balancing not instant?