Geoip lookup

Joe Abley jabley at hopcount.ca
Thu May 23 20:32:03 UTC 2013


On 2013-05-23, at 15:47, shawn wilson <ag4ve.us at gmail.com> 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.

If you are looking for registration data, try looking in one or more of

  ftp://ftp.apnic.net/public/apnic/stats/apnic/
  ftp://ftp.ripe.net/ripe/dbase/
  ftp://ftp.lacnic.net/pub/stats/lacnic/
  ftp://ftp.afrinic.net/stats/afrinic/
  ftp://ftp.arin.net/pub/stats/arin/

(poke around and see what you can find; I didn't spend much time trying, but several/all of the RIRs seem to mirror data from all the others)

Note that "networks in a country" is a funny phrase. The sets

 - address space assigned to all organisations located in country X
 - routes visible in country X (from some viewpoint)
 - all addresses assigned to devices physically located within country X
 - routes that are considered "in-country" in places where billing is aligned with the necessity to traverse a long bit of wet glass

are frequently incongruent. If this matters, you might want to consider a more detailed specification of "networks in a country".


Joe



More information about the NANOG mailing list