Skip to content
abh edited this page Jan 11, 2013 · 1 revision

ASN and IP targeting

The configuration format will be extended to allow targeting by IP and ASN. The IP address will be the EDNS-SUBNET when available.

Preference/priority should be

  • IP
  • IP net (maybe an IP is just an IP net/32). We only need to support /24's for now.
  • ASN+Country
  • ASN+Continent
  • ASN
  • Country
  • Continent
  • "base name"

Configuration format

The JSON configuration is loaded relatively unchanged into the GeoDNS data structure. We might need to change that to keep both configuration and the internal data structures sane.

Currently targeting a country (for example Sweden) for the name "foo" happens by adding an entry in the configuration for "foo.se", a continent is targeted with "foo.europe". (All examples here are omitting the rest of the domain name).

It might make sense to add a "version: 2" key at the top of the file and when that's seen then reverse the format so the system will use "se.foo". (Or we can make a backwards incompatible change - there are very few installations of the software so if it's better then we can manage that.

Another configuration change that might make sense would be changing the format so the top level key is "foo" and then the targeting information is in the hash below foo. This might be much cleaner to work with, in particular adding prefix targeting wouldn't be quite so crazy. It has the disadvantage that without setting up extra aliases you can't query "foo.nl" (though maybe it's inappropriate to expose this information by default anyway).

The examples below will assume we don't "reverse the order" or otherwise change anything.

ASN targeting

We can extend this to cover ASNs by looking for "foo.as123" and "foo.as123.se" (or would that be "foo.se.as123"?).

IP targeting

For supporting /32 and /24 IPs, we can extend it to look for "foo.10.0.0.1" and "foo.10.0.0". We could encode the IP address in hex to avoid the dots, or use a different separator.

Clone this wiki locally