set up geo dns (geodns) on Fedora using geoipdns pt 2

Here I describe the steps of set up Geoipdns (a Tinydns fork at does geo dns). First following these steps here to set up Tinydns. Even though Geoipdns is a fork, it doesn't provide the configuration programs such as tinydns-conf that's in Tinydns. So it's much easier to set up Geoipdns after we already have Tinydns set up.

You can read Geoipdns document on http://pub.mud.ro/wiki/Geoipdns.
Here are quick steps:
$yum install inotify-tools-devel
#geoipdns use libinotifytools.

$mkdir vdns
$cd vdns/
$wget http://pub.mud.ro/~cia/files/vdns-src.tgz
$tar xfz vdns-src.tgz
$vi conf-cc
#Add " -include /usr/include/errno.h" to the first line of conf-cc

$mkdir /usr/local/apps
$cp -rp /usr/local/apps/vdns/bin/* /usr/local/bin/
The last step is to allow us access vdnsd vdnsdb without add to PATH.

Now geoipdns is installed. Next we need to configure it so it does geo dns.
$cd /etc/tinydns
$cp run run.tinydns #backup run
$vi run
#inside run, we change /usr/local/bin/tinydns to/usr/local/bin/vdnsd

$cd root
$vi Makefile
#inside Makefile we change tinydns-data to vdnsdb

$svc -t /service/tinydns

Now vdnsd should be running, use "ps -ef" to see that vdnsd is running tinydns is not, but you still should see "supervise tinydns".
Do some dig to make sure everything still works just like Tinydns is running.

Now you need to query the server from at least 2 different locations, otherwise you don't know if geodns works or not.
If you set up dns on local network, such as, you can put IP's of local machines in "data" and test geodns from these local machine.
If you have a world facing DNS server and you want to test geodns, you can put the IP's of your home, work, colocated server, or VPS in data, then test dns from those locations.

However if you want to test it fast at where you are, you are also in luck, because there're several online dig sites you can use. I will use 2 such sites as examples:
http://dig.menandmice.com/knowledgehub/tools/dig ip is
http://www.subnetonline.com/pages/network-tools/online-dig.php ip is
Note these Ip's are as of this writing. If they have changed at the time of your testing, you need to change them too in your data file.

Now the data. Suppose your DNS server name is ns1.myserver.com (replace it with your real dns server name), add these to your /etc/tinydns/root/data file:
Do a "make" to update the data hash.

Now you can start testing. First do a "dig @ns1.myserver.com www.example.com" locally. It should say Then go to http://dig.menandmice.com/knowledgehub/tools/dig , enter name server "ns1.myserver.com", enter domain name "www.example.com", click "perform query", it should say Now do the same on http://www.subnetonline.com/pages/network-tools/online-dig.php, it should say
If they display correct fake information, your geo dns works.

Next you need to add real IP location data and setup geo dns for your real domains.
I will talk about this in another post.


Chack Boom said...

I found an interesting site: http://www.postpart.com/
You can easily set geoip domain.

Anonymous said...

First of all Excellent Article and Thanks a Lot for it.

If i want to setup Multiple IP BLOCK for Particular One Country,then how can i do it.

%usa: here some more network for this identity "%usa".

Manish said...


This article is very nice but, I am not able to locate that file vdns-src.tgz on that site. If you have a that file then can you load it on your site for download.