One fast way to do this is via Perl - try installing any of these from CPAN:

  Geo::IP
  Geo::IP::PurePerl
  Geo::IPfree

Cheers,
Gavin

On Wed, Oct 01, 2003 at 10:11:46AM +1000, Tim White wrote:
> > ARIN keeps a list of first-level allocations.  A whois query 
> > to whois.arin.net for the IP address of interest should 
> > provide you with a record, from which you can retrieve the 
> > country code and see if it evaluates to AU.  Try it - run 
> > 'whois 203.1.2.3 | grep "^country:"' in a terminal. 
> > Lovely.   Repeat with any IP address you like, maybe even 
> > write a bit of awk
> > or sed or something to strip out everything except the country code.
> 
> Once you find out who ARIN has allocated the IP range to, you can usually go 
> and check their whois server.
> 
> An example would be to do 'whois 203.1.2.3 @whois.apnic.net'. This will give
> you the name and address that APNIC have allocated the IP address to. Often
> these will be ISPs, some of whom have their own whois servers and so on.

-- 
Open Fusion P/L - Open Source Business Solutions [ Linux - Perl - Apache ]
ph:  02 9875 5032                        fax: 02 9875 4317
web: http://www.openfusion.com.au        mob: 0403 171712
- Fashion is a variable, but style is a constant - Programming Perl
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to