[Download]
A 40-line patch for BIND to add geographical filters support to the existent views in BIND. Look at it.
The most popular use of this patch is to send web site visitors to their nearest web server. Suppose you have a site called www.example555.com with two web servers: one in the US and one in England. You can use this patch in order for visitors from Europe to connect to the server in England and all other visitors to the server in the US. This is just one example of its usage. There are probably many others.
BIND 9.2 implements the concept of having multiple views of a single zone. Depending on the client that queries the server, different answers can be returned for the same query. However, BIND only allows to segment clients by IP address or IP address prefixes. This makes it cumbersome if you want to, for instance, target all the networks in France.
By adding the functionality available in Maxmind's GeoIP to BIND, it is possible to filter whole countries without having to specify IP addresses. This is an excerpt of a sample BIND configuration using this GeoDNS patch:
view "north_america" {
match-clients { country_US; country_CA; country_MX; };
recursion no;
zone "example555.com" {
type master;
file "pri/example555-north-america.db";
};
};
view "south_america" {
match-clients { country_AR; country_CL; country_BR; country_PY; country_PE; country_EC; country_CO; country_VE; country_BO, country_UY; };
recursion no;
zone "example555.com" {
type master;
file "pri/example555-south-america.db";
};
};
view "other" {
match-clients { any; };
recursion no;
zone "example555.com" {
type master;
file "pri/example555-other.db";
};
};
As you can see, the zone example555.com has 3 different views, depending on the location of the country.
The original patch for BIND 9.2.4 was written by Nicolas Moldavsky, working for Caraytech, a company in Argentina. Daniel Gerzo adapted the patch to work against BIND 9.4.1-P1. the Neither the authors nor their employers provide any guarantee that this software will work, not even for the purpose it was written for. Use it under your own risk. We have no relation whatsover with Maxmind apart from being a client of their GeoIP Country product. BIND is a product of the Internet Software Consortium. We plan to use this patch for e-planning, our ad server software.
Send all comments or feedback to nico=at=caraytech===com==. Include [bind-patch] in the subject or otherwise your mail will be filtered.