How do I do this?

First of all, you'll need the source.

source
prettified source

You'll also need to download the lists of delegations from the registries. Be sure to get them from arin, ripe, apnic and lacnic.

If you want the country code -> country name lookup to work, you'll need to download the relevant bit of ISO 3166.

Stick it all in the same directory and run it.

  $ ./geoip.pl 207.46.144.222
  ARIN says you are in US (UNITED STATES), 207.46.0.0/16, registered 19970331.
  Oh, and that took 1.1 seconds.
  $ ./geoip.pl 212.58.224.121
  RIPENCC says you are in UK (UNITED KINGDOM), 212.58.224.0/19, registered 19991008.
  Oh, and that took 1.08 seconds.

Enjoy.

Valid HTML 4.01!

Page last modified Monday, 21-Jun-2004 16:52:10 BST (Amazon wishlist)