DNS Failover uses two of the applications in the Constellix suite: DNS and Sonar monitoring. First, we are going to create monitoring checks in Sonar and then apply those checks to failover records in the DNS control panel.
You can watch the full demo here:
In case you need a quick refresher, DNS Failover allows you to configure “backup” endpoints for your DNS records. For example, let’s say we have two web servers located at 188.8.131.52 and 184.108.40.206. The first web server is our primary, while the second is only used when the primary is unavailable. In this case, we would create an A record with failover and add both IP’s to the record in order of priority.
First, you want to log into the Constellix control panel through the Sonar application. Now that you’re logged in, you’ll be able to quickly jump to any of the other Constellix applications by clicking the menu in the top left corner.
Create a monitoring check for your primary endpoint. The endpoint can be an IP address or FQDN (Fully Qualified Domain Name). There are three different kinds of checks you can create: web, TCP, and DNS. We are going to use our example from earlier, so we will need to create a web check to monitor the IP addresses of our web servers.
You’ll notice there are a lot of options when you configure a check. We’ll break them down for you quickly.
You can choose Simultaneous (all locations each check) or Once per Site. What these mean is how many locations will be checks at each monitoring interval.
If you choose simultaneously, this can get expensive if you have checks running every 30 seconds from multiple locations.
If you choose more than one monitoring location, you can choose how a system is determined to be “unavailable”.
If one location is chosen and is down then the check will be considered down. If multiple, then next closest location is checked. If both are down, then down.
Half or more of the locations have detected the endpoint as down.
Choose the expiration of the notification report. This report is included with email alerts when a check is down and shows a detailed traceroute and recent downtime for the check.
When you are done, make sure you test the check by clicking the Test Check button and a monitoring location from the dropdown menu.
If successful, click Save.
Clone the check you just made by clicking the button in the upper right-hand corner of the check configuration screen.
Change the name and IP/FQDN values to match your secondary endpoint. Test the check and save.
Rinse and repeat for however many endpoints you want to include in the failover configuration.
In the top left corner, click the menu button and select the DNS application. In the sidebar click Managed DNS / Domains and select the domain you want to apply Failover to.
Create the appropriate record, for this example we want to create an A record.
Enable Failover in the Record Mode menu.
There are three failover settings you can choose from. Let’s say you have three endpoints called A, B, and C. This is how each setting would failover traffic to each with A being the primary and C being the tertiary.
A to B. If A is back up, then A. If both A and B are down, then C.
A to B, then stops. Stays at B until failover is turned back on.
A to B to C, then stops.
You also have the option to combine failover with round robin, which is our load balancing service. That means each time the record is queried, a different endpoint would be returned. If we have three endpoints in the record, each endpoint has a 33% chance of being returned. If any of these endpoints are down, then they will be removed from the configuration.
Query 1: A
Query 2: B
Query 3: C
Query 4: A is down so B is returned
Query 5: C
Query 6: B
… and so on
Make sure you add your endpoints in order of priority, ie: the first row should be your primary endpoint.
In the Sonar Check column, click the dropdown menu. Any monitoring checks that match the IP/FQDN in that row will appear in the dropdown. Choose the one you want to use with this check and in the Status column you will see the current status of the check.
When you are done adding the necessary endpoints and checks, Save your check and Commit your changes.
Your failover record will propagate instantly to all of our nameservers, so you can immediately query them in a terminal to make sure your record is live.
In the Records screen, you can see which IP/FQDN is being returned in the IP/Pool column with an asterisk.