We've been using GeoDNS to distribute client requests to different data centers around the world, first as a highly experimental project, then more and more as months passed.
Currently we're using it as simple global load balancer for
help.opera.com, and some
However, there is another minor feature that we built into it, like a hacker's backdoor :) Since it's using a full DNS server, and it relies on having GeoIP libraries installed and always up-to-date, we thought it was a nice and cool idea to have a quick way to perform geo-ip lookups from the command line.
It works in a similar way as DNS black lists do. Suppose you want to look up the IP address
22.214.171.124. You reverse the IP, and lookup a special
cosimo@cd01:~$ host -t TXT 126.96.36.199.lookup.geo.opera.com 188.8.131.52.lookup.geo.opera.com descriptive text "ip:184.108.40.206, country:de, continent:europe"
This uses the GeoDNS backends to resolve country and continent of the given IP address, and gets back the information in a very basic string format. A simple shell or Perl script can then process that for you if you need. In fact, I made a
~/bin/geolookup Perl script that I can use like this:
cosimo@cd01:~$ geolookup 220.127.116.11 18.104.22.168 100.110.120.130 22.214.171.124 => de, europe 126.96.36.199 => fr, europe 100.110.120.130 => unknown, unknown
Nothing special, but in this way, no matter what machine I'm on, I can always quickly lookup IPs if I need to, without having to download the Country or City GeoIP databases, and keep them up-to-date. On the geodns backends, this is of course done routinely with a set of simple cronjobs.