Geoip lookup

chip chip.gwyn at
Thu May 23 21:06:24 UTC 2013

I've used the MaxMind Lite geo-ip database plus some perl modules and a BGP
table to get something fairly close.  Anything in the BGP table that was
larger than a /20 I split into /20's.  For my use case, this was close
enough.  I then grabbed 30 or so IP's within the range and geo-ip mapped
them.  You can then apply some algebra and get a general idea of where
things are or are not.

Things I used: - For
ip/prefix/lat-lon mapping - For Geo-IP
lat/lon data - Maxmind's city database - for BGP
prefix/mask + src ASN info

Good luck!


On Thu, May 23, 2013 at 3:47 PM, shawn wilson < at> wrote:

> What's the best way to find the networks in a country? I was thinking of
> writing some perl with Net::Whois::ARIN or some such module and loop
> through the block. But I think I'll have to be smarter than just a simple
> loop not to get blocked and I figure I'm not the first to want to do this.
> I've noticed some paid databases out there. They don't cost much but are
> they even worth what they charge? Ie, doesn't list
> quite a few addresses from a country I've looked at blocking. Isn't this
> information free from the different *NICs anyway?
> This is probably two questions: a program that smartly looks for country's
> blocks in a block and are GeoIP services worth anything?

Just my $.02, your mileage may vary,  batteries not included, etc....

More information about the NANOG mailing list