How do DNS-based load balancing and failover work, and what are their limits?
AdvancedConceptDNS
Answer
The authoritative server returns different or multiple A records, optionally filtered by health. Clients pick one and cache it for the TTL, so failover takes at least TTL plus client retry time, and you have no control over client behavior.
Some clients cache beyond TTL (long-lived JVMs with networkaddress.cache.ttl, connection pools). For fast failover use a load balancer or anycast in front and treat DNS as coarse steering.
More on DNS
What does DNS do and what happens when you type a URL into a browser?BeginnerWhat are the common DNS record types?BeginnerWhat is the difference between a recursive resolver and an authoritative server?IntermediateExplain the DNS resolution chain step by step with dig.IntermediateWhat is TTL in DNS and how does it affect changes?BeginnerWhat is negative caching in DNS?Intermediate