If you looking for server failover solution. You can try this link to update DNS records automatically https://www.howto-expert.com/how-to-create-a-server-failover-solution/.
It works as
A primary server and a secondary server. A third server monitors the primary server and detects if there is a problem. If there is, it will automatically update the DNS records for your website so that traffic will be diverted to your secondary server. Once your primary server is functioning again, traffic will be routed back to your primary server. Most of the time your users won’t even notice a thing!
Posted On: 12-Jun-2017 02:00