An answer group is a shared label allowing identifying metadata to be linked among a select number of possible DNS IP address answers. In NS1’s Filter Chain technology, answer groups are used to accomplish advanced routing goals.
In a filter chain, filters are organized in a specific order—defining requirements that are used to filter out suboptimal endpoints. As the answers and metadata are filtered through the chain, each filter refines the list of DNS IP addresses. At the end of the chain, the single best IP address remains and is returned to the user as their DNS query answer.
The Select First Groups filter works with the answer group’s metadata in a filter chain to determine those DNS IP address answers that are most relevant to the desired DNS traffic routing for a specific query. Only those IP addresses that share the metadata label, and therefore an answer group, with the IP address initially selected by the previous filter remain in the Filter Chain.
Here's an example use case demonstrating how the answer group works within a filter chain:
Setup: Your network is divided into three server clusters in the continental United States, one located in each of the three cities: Dallas, New York, and San Jose. Each server cluster contains three servers where one server in the cluster is twice as powerful as each of the other two.
Desired Outcome: You want users in the US to be routed geographically to the closest server cluster from their location. You also want traffic for each cluster to be split among the three servers to ensure 50% of the traffic goes to the most powerful server, and the other two servers split the remaining 50% of the traffic evenly between them.
Solution: Using NS1’s filter chain technology, we will create the desired outcome using the following filters in this order: Geotarget Regional, Select First Group, Weighted Shuffle, Select First N.
Prior to setting up the Filter Chain, we need to configure the IP addresses for each server in each data center location into answer groups, and then assign metadata to both the groups and individual IPs.
To set up the example Filter Chain shown above:
Create IP answers for each of the nine servers.
Move the nine servers into three distinct answer groups: Dallas, New York, and San Jose.
Assign each group a geo-region based on the location of the datacenter. (i.e. US-West for the San Jose datacenter, US-East for the New York datacenter, and US-Central for the Dallas datacenter.)
Assign a weight to each individual IP address answer, setting a higher value for the more powerful server at each datacenter (in this case, we assigned a value of 20), and a lower value (in this case, 10) to the other two servers. This ensures that the more powerful server is assigned twice as much traffic as the other two servers, or 50% of the traffic.
When a query is sent to the Filter Chain, each filter will use the configured parameters to decide which of the IP answer or answers will move to the next filter in the chain. After all of the filters have evaluated, sorted, or eliminated answers, the remaining IP address is returned to the user as the best solution for that user at that time.
The Geotarget Regional filter will sort the answer list in order from geographically closest to geographically furthest away.
The Select First Group filter looks at the first answer in the list and selects the answer group for the first IP address answer. It removes all other answers that do not share the same answer group—limiting the answers to only those IP addresses in the selected IP answer group.
Since the Geotarget Regional filter sorted the IP answer list in geographical order by distance from the requester's IP address location, the first IP address answer in the list is a server that is closest to the user.
Note: Since the Geotarget Regional filter sorted the IP answer list in geographical order by distance from the user’s given IP address location, the first IP address answer in the list will be a server that is closest to the user.
The Weighed filter will shuffle the remaining IP address answers, giving priority to the IP address with the higher weight (in this case, 20).
The Select First N (with N=1) filter will return the top answer in the sorted list of IP addresses.
The resulting IP address is delivered to the requesting client.
This is just one example of the use case for answer groups. If you have any questions about your use case or how to optimize your filter chain, contact the NS1 customer support representative.