Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
On Wed, 3 Jul 2002, Nimrod Levy wrote:
> You could do a dns lookup on the address, then spit out the tld from the
> name. That's how webalizer does it.
nslookup will often fail to give you any answer. When it does give an
answer, you can't always tell which country the machine is in. I don't
know if there's any way around that though, when you want a script to do
the work. By hand, I use arin:
whois -h whois.arin.net xxx.xxx.xxx.xxx
But that often leads to RIPE or to APNIC. I think you can use this list
to decide how to do a whois lookup:
http://www.iana.org/assignments/ipv4-address-space
(ripe, apnic, arin, etc.), but I don't know how to just take the country
from the list.
So it would be hard to do it really well. Anyway, the original answer was
pretty good. Use nslookup, but you'll have a lot of visitors who can't be
assigned to a country.
Mike
> On Tue, Jul 02, 2002 at 05:24:39PM -0500, Ross, Matt wrote:
> > Is there a simple way to take an IP address in perl and spit out what
> > country it came from?
> >
> > I'm trying to make a log report list by countries visiting.
--
To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
Archives are available at http://mlug.missouri.edu/list-archives/