Balancing at the name layer
Before a client ever opens a connection, it resolves a hostname to an address. DNS based load balancing uses that resolution step to distribute clients across many servers, without any dedicated balancing device in the path.
How it works
- A name is configured with multiple address records, one per server.
- The resolver returns the list, often rotating the order, a technique called round robin DNS.
- The client typically tries the first address it receives, so rotation spreads clients across servers.
The big limitation is caching. Resolvers and clients hold answers for the time to live, so a server that fails keeps receiving traffic until cached records expire. DNS also has no view of server health or load, so it cannot avoid an overwhelmed instance. These weaknesses mean DNS balancing is usually a coarse first layer, paired with a smarter balancer closer to the servers.
Key idea
DNS load balancing returns multiple addresses and rotates them to spread clients, but caching and the lack of health awareness make it a coarse first layer.