|
Project Information
Members
Links
|
Usage
NotesUses the Max-Mind Free Open Source Geo-Lite Country database (www.maxmind.com). It's slower the first time you generate a set of countries, the countrycode map files are created and saved in #{$OURDIR}. After the first time, the countrycode map is reused. It's faster to use --repeat than to make a Bitfield to store whether each IP has been produced. There is another geoIP database here http://software77.net/cgi-bin/ip-country/geo-ip.pl How to dns resolve a countryThis can aid in testing the accuracy of the Max-Mind location data by finding the presence of ip blocks that are potentially allocated to the wrong country. For example, if hostnames ending in .sk are found in a specific IP range belonging to New Zealand then that indicates the IP range allocation is incorrect. For faster dns resolving, use an asynchronous resolver like adns. Install GNU adns Download and follow instructions from http://www.chiark.greenend.org.uk/~ian/adns/ Pipe IPs to adnsresfilter and only output resolved IPs ./geoipgen nz | adnsresfilter -w -a | egrep "\[.*\]" Example Output 125-238-151-47.broadband-telecom.global-gateway.net.nz[125.238.151.47] 161-65-114-241.ip.fx.net.nz[161.65.114.241] c0.d0.33.static.xlhost.com[209.51.208.192] 203-114-177-78.dsl.sta.inspire.net.nz[203.114.177.78] ds7a04.cc.waikato.ac.nz[130.217.64.150] CreditsAuthored by Andrew Horton (urbanadventurer) horton.nz at-nospam gmail.com Thanks to Max-Mind for making their Geo-Lite Country database freely available. Thanks to Peter Cooper for the use Bit Field Bitfield is MIT Licensed, (c) 2007 Peter Cooper (http://www.petercooper.co.uk/). |