DNS Failover (DNS Failover)
The Importance of DNS Failover
DNS failover provides basic high availability without requiring a dedicated load balancer. When your primary server goes down, the monitoring system updates the DNS record to point to a backup server, and new visitors are directed to the working server. This is simpler and cheaper than load balancer setups for smaller sites.
However, DNS failover has limitations. The failover time depends on the TTL of the DNS record. With a 300-second TTL, it can take up to 5 minutes for all visitors to reach the backup server after the primary fails. Some DNS resolvers cache aggressively beyond the TTL, extending the failover time further.
DNS failover works best as one layer in a reliability strategy. For fast failover (under 30 seconds), an application-level load balancer or anycast routing is needed. DNS failover is best suited for less time-sensitive services or as a secondary failover mechanism behind other HA systems.
How to Verify
If you use DNS failover, verify that health checks are running against the correct endpoints and that the backup server is actually available. Test failover by temporarily taking down the primary and verifying traffic redirects within the expected time based on your TTL settings.