This article describes an automatic failover configuration for an A record where NS1 is configured to automatically shift traffic to a secondary IP (which normally receives no traffic) upon detecting a failure of your primary IP.
Refer to this article for instructions on setting up manual failover. This can be used for CNAME and other record types compatible with a failover configuration.
Step 1: Configure a monitor
If you're using NS1's built-in monitoring, follow the instructions for creating a PING or TCP monitor. Alternatively, NS1 provides pre-configured integrations with the following third-party monitoring services:
- Amazon CloudWatch
- Rackspace Cloud Monitoring
- New Relic
For this example, we'll use built-in NS1's monitors to configure automated failover.
Step 2: Create an A record
In the NS1 portal, click on the Zones tab, and select a zone.
Click the Add Record button.
Enter the domain. (e.g. abc.example.web)
Under record type, select A from the drop-down menu.
Enter your desired TTL.
Set the answers for this record.
Click Save All Changes.
Step 3: Prepare the record for failover
After creating the A record, click the record to navigate to the record's configuration page.
Use the breadcrumb navigation to ensure you are working within the correct record.
- Click Create Filter Chain.
- From the list of filters, find the Up filter, and click the + icon to the left of it (or drag-and-drop) to add it to the chain.
Next, click the + icon next to the Priority filter (or drag-and-drop) to add it to the chain.
Next, click the + icon next to the Select First N (or drag-and-drop) filter to add it to the chain.
Click Save Filter Chain.
The new filter chain sorts answers by (1)removing any answers that are "down," and then by priority as (based on the value you'll define in the next step). It them uses the Select First N filter (which, by default, is set to N=1) to tell the system only to return the first (highest priority) answer.
Step 4: Configure metadata for failover
After adding both server IPs into the A record config and setting up the filter chain, you must define the up/down state and the priority value for each server (or answer).
Click each Filter button at the left to reveal the metadata associated with your Filter Chain.
- Click the "up" meta data for your answer and the metadata modal will appear. Select the black icon under feed to reveal your feeds/monitors available. Select your monitor and hit save.
Click the "priority" filter and set the priority of the primary IP (188.8.131.52) to 1 (note: lower numerical value indicates higher prioritization).
Under the secondary IP's metadata section, connect your secondary monitor or data feed.
Select the "priority" for the secondary IP (184.108.40.206) and set it equal to 2.
Click the Save button.
Your record configuration should now look like this:
At this point, if the monitor on your primary server trips, the corresponding answer will be updated to up status of "false" in the NS1 platform immediately.
If you have other DNS records serviced by the same servers, you can reuse the same Data Feeds in those records too. Updates to a Data Feed will automatically be pushed to every connected answer throughout our system.