That DNS

GeoDNS Plugin

  1. Working
  2. Example

Working

The plugin is actually implementing the dns.ResponseWriter to modify the response from other plugins, like File. The plugin implementation has different approach for different queries.

Non-A and Non-AAAA Record

Whenever a query contains anything other than A or AAAA it is simply ignored, to avoid any configuration changes the plugin will transparently resolve records that are like CNAME, MX, etc.

Single IP A or AAAA record

Similar to other records, if there's no choice in A or AAAA records they are also transparently passed along to avoid latency.

Multiple IP A or AAAA records - Same Continent

With current implementation the IP A-records or AAAA-records are checked for distance and continent with the client IP. If the client IP has same continent as some of the records all those records are responded.

Multiple IP A or AAAA records - Distance

With current implementation the IP A-records or AAAA-records are checked for distance and continent with the client IP. If the client IP continent has does not match with any of the records, it will do a distance match and respond with the nearest ones. Removing the outliers by filtering the mean distance.

Example

Let's try to resolve the Record for test1.sub.thatwebsite.xyz from two different locations, AS and EU.

    $ dig @ns1.thatdns.xyz +noall +answer test1.sub.thatwebsite.xyz

Let's break the command.

Now expected answer will be with two IPs - "172.104.160.xxx" (Singapore) and "172.105.64.xxx" (Germany).

Following are the scenarios: