GeoIP

DreamHost currently provides GeoIP as a Ruby 'Gem' and a Perl module.

Perl Module
To access the GeoIP Perl module, type the following at your shell prompt: geoip-lookup [-l] 

Default output is two character country code; -l option prints the country name.

Access Perl Module from PHP
Access the Perl Module using the shell_exec command in PHP, as in the following example: 

Setup The Real Geo::IP Perl Module

 * 1) Download Geo IP C API, install to /home/username/src/GeoIP-1.4.3/
 * 2) Download Geo::IP from package
 * 3) Use this to build

perl Makefile.PL LIBS='-L/home/username/src/GeoIP-1.4.3/libGeoIP/.libs' PREFIX='~/perlmods' VERSION_FROM='lib/Geo/IP.pm' NAME='Geo::IP' make make install