Open emAmazed opened 9 years ago
sudo apt-get install geoip-bin
sudo yum install geoip
geoiplookup xxx.xxx.xxx.xxx
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget -N http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz gunzip GeoLiteCity.dat.gz gunzip GeoIP.dat.gz gunzip GeoIPASNum.dat.gz sudo cp GeoIP.dat GeoLiteCity.dat GeoIPASNum.dat /usr/share/GeoIP/
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget -N http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
gunzip GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoIPASNum.dat.gz
sudo cp GeoIP.dat GeoLiteCity.dat GeoIPASNum.dat /usr/share/GeoIP/
geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat xxx.xxx.xxx.xxx
curl ipinfo.io/xxx.xxx.xxx.xxxx
Install MaxMind Command line GeoIP databases,
To install geoiplookup on Debian, Ubuntu or Linux Mint:
sudo apt-get install geoip-bin
To install geoiplookup on CentOS, first enable EPEL repository.
sudo yum install geoip
Look up IP GeoInfo
geoiplookup xxx.xxx.xxx.xxx
Install additional GeoIP databases from MaxMind, set up a monthly cron job
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget -N http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
gunzip GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoIPASNum.dat.gz
sudo cp GeoIP.dat GeoLiteCity.dat GeoIPASNum.dat /usr/share/GeoIP/
Obtain City leve geolocation info
geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat xxx.xxx.xxx.xxx
Using JSON-based geolocation API to obtain GeoIP information
curl ipinfo.io/xxx.xxx.xxx.xxxx