This article overviews the process for configuring automatic failover of DNS endpoints in your network — meaning, if one DNS endpoint goes down, the NS1 platform will automatically redirect traffic to the next available endpoint.
Refer to Configuring manual DNS failover to learn how to set up manual failover (as opposed to automatic), which can be used for CNAME records or other record types that are compatible with a failover configuration.
Refer to any of the following articles to learn how to create an NS1 monitor (i.e., probe):
Alternatively, you can configure a data source from NS1's API webhook or a third-party monitoring service integration. Integration-specific guides can be found here.
The example used in this article uses NS1's built-in monitors to configure automatic failover.
In this step, you will create a DNS record for the zone you just selected. You will add answers to this zone to represent endpoints to which traffic should be distributed. As you complete the remaining steps in this article, your goal will be to set up a Filter Chain to determine the optimal endpoint for each DNS query.
Refer to Create a DNS record for detailed instructions and more information about every DNS record type supported by NS1.
To create a DNS record:
In the NS1 Connect portal, click the DNS link in the navigation. By default, the Zones page opens, where you can view a list of zones associated with your account.
Click the name of the zone from the list to drill down into zone details, including a list of records if any exist.
Click Add record or the + icon to open the Add Record modal.
Select a record type from the drop-down menu. Optonally, you can specify a name (or a subdomain for the zone), or leave it blank to create a root-level record. You can also specify a TTL (time-to-live value) in seconds; the default TTL is 3600 seconds.
Add one or more answers to the record. The information required for an answer depends on the record type you chose in the previous step.
For more information on the different types of records and their supported answers, refer to Create a DNS record.
Once complete, click Save record. The new record appears in the list.
The Filter Chain you are about to create processes answers by:
Removing any answers that are down (i.e., up=false),
Rearranging answers based on their assigned priority value, then
Reducing the list to the first N number of answers in the answer pool.
To create a Filter Chain:
Click the name of the record you just created to drill down into record details, then click Create Filter Chain.
Add the Up filter, Priority filter, and the Select First N filter in that order. To add a filter, click the + icon to the left of the filter name. Then, click Save Filter Chain.
Next, you must adjust the answer metadata — connecting the monitor(s) or data source(s) you created in step 1 to their corresponding answers.
To route traffic appropriately for an automatic failover scenario, you must edit the metadata for each answer to connect a monitor or data source to determine whether it is up or down, as well as to assign a priority value for each answer that you want the Filter Chain to manage.
To add metadata to allow filters to direct traffic accordingly:
Back on the record details page, click the Up filter to see the corresponding metadata label appear beneath each answer. Then, click the label beneath the first answer to display the answer metadata modal.
Click the Feed icon and select the monitor or data feed to associate with this answer. Then, click OK. Repeat this step for all remaining answers.
If you have other DNS records serviced by the same servers, you can reuse the same data feeds in those records. Updates to a data feed are pushed automatically to all associated answers.
Back on the record details page, click the Priority filter to reveal the priority metadata field beneath the first answer and assign a priority value. A lower number indicates a higher preference when making traffic routing decisions. Repeat this step for all remaining answers.
Click Save record.
Now, the monitor or data source you assigned to each answer will keep it up to date. Upon each DNS query, the answers are filtered through the Filter Chain using the following logic: First, all "down" answers (i.e., endpoints) are removed from the answer pool. Then, the answers are arranged based on their assigned priority value. Finally, all but the first "N" number of answers are removed from the list and the remaining answer(s) are returned to the requester. By default, N is set to 1 meaning only the first answer (i.e., available and highest priority) is returned to the requester.