Geographic-based traffic steering is a common technique used to connect users to the closest available endpoint. The geographic-based traffic steering filters compare the location of the requesting client against that of each answer (as in, each application endpoint) specified in the DNS record and then rearrange the answer list based on proximity or eliminate answers that do not meet some geographic criteria. You can add any of these filters to the Filter Chain for a DNS record in tandem with other traffic steering filters—such as the Up filter and Select First N filter.
Each incoming DNS request comes through a recursive DNS resolver; therefore, the IBM NS1 Connect platform can either use the location of the resolver as a point of reference or, if the EDNS client subnet (ECS) extension is enabled and supported by the resolver, then the NS1 Connect platform can more accurately determine the client's geolocation based on partial IP address forwarded by the resolver.
There are two main types of geographic filters:
-
Geotargeting filters rearrange the list of answers based on the client or resolver's proximity to a geographic midpoint of the defined geolocation metadata. For example, if you set the answer's Geographic region metadata to "US-WEST," then the geographic center of the Western United States is used as the point of reference when calculating proximity. Similarly, if you set the US State(s) metadata to "New York," the center of New York state is referenced.
-
Geofencing filters eliminate answers whose geolocation does not match that of the requester. If no answers match the geolocation of the requester, then only answer(s) without any geolocation metadata are returned. If there are no such answers, then no answers are provided in the response. You can use geofencing filters to use in-country CDNs or restrict user data within a specific country.
Note
Both geofencing filters provide an option to Remove answers that don’t match location metadata if any match. If the option is disabled, the requester will receive the answer(s) matching their geolocation and any answers that do not have geolocation metadata. If this option is enabled, the requester will only receive the answer(s) matching their geolocation if one is available. If the option is enabled but no answers match the requester's geolocation, then the requester will receive any answer(s) without geolocation metadata.
There are five geographic-based traffic steering filters:
Filter |
Description |
Related metadata field(s) |
---|---|---|
Geotarget Country filter |
This filter rearranges the list of answers from nearest to farthest from the requesting client or resolver based on the country, subdivision, US state, or Canadian province metadata—referencing the most granular geolocation details defined in the answer metadata. Refer to ISO 3166-2 subdivision codes for details. |
Country/countries Canadian province(s) US State(s) Subdivisions |
Geotarget Regional filter |
This filter rearranges the list of answers from nearest to farthest from the requesting client or resolver based on the geographic region metadata for each answer. |
Geographic region |
Geotarget Latlong filter |
This filter rearranges the list of answers from nearest to farthest from the requesting client or resolver based on the defined latitude and longitude coordinates for each answer. |
Latitude Longitude |
Geofence Country filter |
This filter eliminates answers in which the country, subdivision, state, or province metadata does not match the requester's location. If the requester's location does not match the metadata for any answer, all answers without a defined geolocation are returned. If the requester's location does not match the metadata for any answer and all answers have an associated geolocation, then no answers are returned. |
Country/countries Canadian province(s) US State(s) Subdivisions |
Geofence Regional filter |
This filter eliminates answers in which the geographic region metadata does not match the requester's location. If the requester's location does not match the metadata for any answer, all answers without a defined geolocation are returned. If the requester's location does not match the metadata for any answer and all answers have an associated geolocation, then no answers are returned. |
Geographic region |
Note
Despite the naming, US regions include all regions in North America. For example, US-WESTincludes of some Canadian provinces and the western United States.
Consider the following when using a geographic-based traffic steering filter:
-
In general, do not use a geotargeting and geofencing filters in the same Filter Chain. If you must, be sure to use different geographic metadata for each filter to reference.
-
Consider using answer groups if you have multiple endpoints in the same geolocation.
-
If using a geotargeting filter (rearranges answers), do not use another sorting filter as this could void the organization applied by the geo filter.
-
Ideally, when using geotargeting filters, you should have a one-to-one mapping of answers to the geographic locations that you’re targeting. If you have endpoints in California, New York, Texas, and Illinois, assign the appropriate US states to those endpoints and leave all other geolocation metadata fields empty.
-
Be as granular as possible when you use the Geotarget Country filter. For example, choose a subdivision over an entire country when possible.
-
If using a geofencing filter, ensure you have a "fallback" answer with no geolocation metadata defined. This answer will be returned to requesting clients whose geolocation does not match any of the other answers.
-
Do not rely on geofencing filters as your only method for mapping users to specific content based on their region or gating content altogether. This is because, whenever possible, the NS1 Connect platform will return some answer to ensure clients can access your domains.
-
Setup
You have endpoints in the following locations: San Francisco, New York City, Budapest, London, and Singapore. Assume you’ve already set up monitoring for each of your endpoints.
-
Desired Outcome
You want clients to be directed to the nearest endpoint to ensure that the connection between the client and your servers remains speedy.
-
Solution
You create a Filter Chain with filters in the following order: Up, Geotarget Country, Select First N. You add the country metadata of each of the endpoints to the answers in the list, then specify that only the first answer should be returned.
Before setting up the Filter Chain, we should add the endpoints as answers for this record. From there, we can add the country metadata for these endpoints.
Note
In some cases, you may find it more useful to set subdivision-level or latitude and longitude-level metadata for your endpoints instead of country-level. In cases where you must direct traffic among several endpoints in adjacent countries or multiple endpoints in a single US state, you should opt for a more granular approach.
The following screenshot shows how we have set up our Filter Chain and metadata based on the setup outlined previously:
To set up this Filter Chain and geotarget based on latitude and longitude:
-
Create endpoint answers for each of the servers.
-
Include Up, Geotarget Country, and Select First N in the Filter Chain.
-
Specify that only 1 answer should be kept for the Select First N filter.
-
Assign country or subdivision metadata to each endpoint, then save the record. To add this metadata, click the Geotarget Country filter to populate answers with the tags, then click the subdivisions tag to add the corresponding subdivisions.
When a query is sent to the Filter Chain, filters are evaluated from top to bottom. Each filter uses the configured parameters to decide which endpoint clients should use, depending on their location. After all of the filters have sorted the available answers, the final endpoint is returned to the client as the best solution.
-
The Up filter determines whether an endpoint is available.
-
The Geotarget Country filter finds the endpoint closest to the client or resolver.
-
The Select First N filter eliminates all but the number of answers that you specify.
-
Setup
You have two endpoints: A Chinese content delivery network (CDN) and a CDN that you use for the rest of the world.
-
Desired Outcome
You want to direct users in China to a Chinese CDN while the rest of the world is directed to another CDN.
-
Solution
You assign the CN country metadata to the Chinese CDN. Then you create a Filter Chain in the following order: Up, Geofence Country, and Select First N.
The following screenshot shows the Filter Chain and answer list setup for this scenario:
To set up this Filter Chain and set up a geofence for China vs. the rest of the world:
-
Create answers for the Chinese CDN and the CDN you use for the rest of the world.
-
Assign country metadata to each of the CDNs.
-
Geofence by country by creating a Filter Chain in the following order: Up, Geofence Country, Select First N.
-
Specify that only 1 answer should be kept by clicking the Select First N filter in the Filter Chain and typing 1 in the number of answers field.
When a query is sent to the Filter Chain, each filter uses the configured parameters to decide which endpoint clients should use, depending on their location. After all filters have sorted the available answers, the final endpoint is returned to the client as the best solution.
-
The Up filter determines whether an endpoint is available.
-
The Geofence Country filter eliminates answers in which the country, subdivision, state, or province metadata does not match the requester’s location.
-
The Select First N filter eliminates all but the number of answers that you specify.