GeoIPlookup
rpm -Uvh http://mirrors.kernel.org/fedora-epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
Install EPEL repo first.
yum install geoip
geoiplookup 8.8.8.8
Install geoip and try geoiplookup
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoIPASNum.dat.gz
gunzip GeoLiteCity.dat.gz
sudo cp GeoIP.dat GeoIPASNum.dat GeoLiteCity.dat /usr/share/GeoIP/
Install geoip databases from Maxmind website
http://geolite.maxmind.com/download/geoip/database/
geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat 23.66.166.151
Try again to locate city name from database file "GeoLiteCity.dat"
P.S. It is another online method to check : curl ipinfo.io/8.8.8.8
cat /tmp/ip.txt | awk '{ system("echo `geoiplookup "$1" |grep Country |cut -d ':' -f2` `geoiplookup "$1" |grep City |cut -d ',' -f4,5` "); print }'
eg result :
US, United States
8.8.8.8
US, United States
73.170.190.82
MD, Moldova, Republic of
89.28.41.90
Use awk in file to find geoip and locate the city and country name
Server is hosted by Alanstudio
Linux Operating System
Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.
|