geoip-lookup - lookup country for IP address or hostname
geoip-lookup [-l] <ipaddress|hostname>
The geoip-lookup program will return the country for the IP address or hostname given as the first command line argument. It queries uses the database in /usr/local/geoip/Geo-IP.dat.
/usr/local/geoip/Geo-IP.dat
By default it prints the ISO 3166 country code. Use the -l option to print the country name.
-l
Lookup up country for IP address 65.15.30.247
# geoip-lookup 65.15.30.247 United States
T.J. Mather <tjmather@tjmather.com>
To install Geo::IP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::IP
CPAN shell
perl -MCPAN -e shell install Geo::IP
For more information on module installation, please visit the detailed CPAN module installation guide.