Getting IP geolocation on Ubuntu with MaxMind geoip

In this howto I will show you how to install MaxMind geoip on Ubuntu and how to use it.

Installation
First install the software :

aptitude install geoip-bin
mkdir /usr/local/share/GeoIP
cd /usr/local/share/GeoIP
wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
ln -s /usr/local/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat

To use it :

geoiplookup 84.226.106.171