Geographic filters

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 IBM NS1 Connect® platform can more accurately determine the client's geolocation based on partial IP address forwarded by the resolver.

There are two subcategories of geographic-based 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:

Table 1. Geographic filters
Filter Description Related metadata
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 more information.

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 arranges the list of answers, beginning with the one closest to the requesting client or resolver, based on the latitude and longitude specified in the answer metadata.

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 any answer, answers without a defined geolocation are returned. If there is no match and all answers have a designated location, then all answers are eliminated, and the requester will receive a NODATA or NOERROR response.

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 any answer, answers without a defined geolocation are returned. If there is no match and all answers have a designated location, then all answers are eliminated, and the requester will receive a NODATA or NOERROR response.

Geographic region

Note: Despite the naming, US regions include all regions in North America. For example, US-WEST consists of some Canadian provinces and the western United States.

Best practices

Consider the following when using a geographic-based traffic steering filter:

  • Avoid using geotargeting and geofencing filters in the same Filter Chain. If you must, use different geographic metadata for each filter to reference.
  • Consider using answer groups if you have multiple endpoints in the same geolocation.
  • In general, do not place a sorting filter after a geotarget filter. Doing so would overwrite the answer order, nullifying the geographic filter altogether.
  • 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, include a fallback answer with no geolocation metadata defined. This answer will be returned to requesting clients whose geolocation does not match any other answers.

Example: Geotargeting between multiple endpoints

Suppose you have application endpoints in San Francisco, New York City, Budapest, London, and Singapore. You would like your application users to be directed to their closest endpoint so the connection between the client and your endpoints remains speedy.

Within the corresponding DNS zone, you create an A record with five answers—one for each location. Each answer includes the IPv4 address of the host server. Additionally, you configure monitors to track the up/down status of each endpoint, connecting each monitor feed to the "Up" metadata in the corresponding answer to enable automatic updates. For each answer, in the Country metadata, you specify the country of the endpoint corresponding to each IPv4 address.

Note: If you have multiple endpoints relatively close together, consider specifying the subdivision or latitude/longitude metadata instead of country metadata.

To define and activate the traffic steering policy, you create a Filter Chain within the A record using the following filters (in this order):

  • Up filter
  • Geotarget Country filter
  • Select First N filter

When the A record is queried, the Up filter eliminates answers whose up/down metadata indicates a "down" status (or up=false). Then, the Geotarget Country filter rearranges the answer list from the closest to the farthest endpoint from the requesting client or resolver. Finally, the Select First N filter eliminates all but the first answer, ensuring only the best answer is returned in the response.