DNS failover


For many actual servers at the back end of the load balancing scheduler, we can fully understand their status in real time through the monitoring system. Once a server is found to have failed, it needs to be immediately removed from the scheduling policy, that is, DNS records directed to the server are suspended, so as to prevent users from visiting the failed server and feeling puzzled.
For DNS-based load balancing systems, it is really a headache to do this, because there is a real problem that we generally do not set the TTL of DNS records to 0, which makes all changes to DNS records take a certain time to take effect. For example, if the TTL of a DNS record is 3600 seconds, then the update to it will take at most one hour to take effect, which is intolerable to us, and of course, users cannot tolerate it.
On the other hand, how to modify the DNS records immediately after realizing the failure is also a problem that we need to consider. The only thing we can do is to modify the DNS records as soon as possible when we have to tolerate the delay in updating the DNS records.
It sounds not difficult at all. Maybe you have set up a dedicated DNS server for your site, then you can quickly complete the task by modifying the configuration. If you are using a third-party DNS service, it doesn’t matter. DNS modification can also be completed through the domain name management platform. However, these all depend on manpower. Indeed, they are not fast enough and automatic enough. The key time is everything, especially when it is necessary to integrate with the monitoring system to realize automatic failover, these methods are not enough.
Perhaps you’ve heard of dynamic DNS, which is actually a feature of the DNS protocol (Standard Dynamic update DNS, DDNS, RFC2126). it allows DNS servers to open specific services, making it possible for us to automatically modify DNS records remotely.
This reminds me of a function supported by almost all broadband routers now, that is dynamic domain name resolution. Do you still remember it? When your host uses a dynamic IP address to access the Internet and you want to point a domain name to this host, the so-called dynamic domain name resolution plays a role. What it does is very simple. It updates the DNS server in time every time the IP address changes. Of course, a certain delay is still inevitable, also because of the TTL of DNS records.
Using the same idea, when we detect the failure of an actual server, we can quickly modify DNS records through dynamic DNS protocol.