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 are 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:
For this example, we will use NS1's built-in monitors to configure automated failover.
Step 2: Create an A record
- Log in to the NS1 portal (via https://my.nsone.net).
- Click DNS in the main navigation to view a list of all DNS zones associated with your account.
- Click on the desired zone within your list. Select the Records tab, then click the Add Record button.
- In the Record Type drop-down menu, select A from the drop-down menu.
- Enter the domain (e.g. www.examplesite.net).
- Enter your desired TTL (default is 3600).
- Enter answers within the Answers field, clicking the Add Answer button after entering each one.
- Click Save All Changes after filling out all desired fields.
Step 3: Prepare the record for failover
- After creating the A record, click the record (now listed in the Records tab within the zone in which you created it) to navigate to the record's configuration page.
- Click Create Filter Chain.
- From the list of filters, find the Up filter (highlighted in the red box below), and click the "+" icon to the left of it (or drag-and-drop) to add it to the chain.
- Next, find the Priority filter (highlighted in the red box below), and click the "+" icon to the left of it (or drag-and-drop) to add it to the chain.
- Next, find the Select First N filter (highlighted in the red box below), and click the "+" icon to the left of it (or drag-and-drop) to add it to the chain.
- Click Save Filter Chain.
The new filter chain sorts answers by removing any answers that are "down," and then by priority (based on the value you will define in the next step). It then 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. In this example, we first select the Up filter.
- Click the "up" metadata for your answer and the metadata modal will appear.
- Select the black icon under the Feed column header to reveal your feeds/monitors available. Select your monitor and click the Ok button.
- Click the Priority filter and set the priority of the primary IP (188.8.131.52) to 1 (note: lower numerical values indicate higher prioritization).
- Under the secondary IP's metadata section, connect your secondary monitor or data feed.
- Select the "priority" filter for the secondary IP (184.108.40.206) and set it equal to 2.
- Click the Save Record button.
- Your record configuration should now look like this, with the exception that your specifically selected monitors and data feeds would be listed next to the priority value under each IP:
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.