[thelist] Countries in web logs?

Lindsay Evans lindsay at redsquare.com.au
Wed Sep 4 19:16:01 CDT 2002


Hi Erick,

> hi, does any one know how my "webalizer" knows that people connected from
> germany, italy, belgium etc? the only thing i see in my server logs are
> ip addresses, so how does the log analyzer calculate? by "reverse DNS"?

yep.

> if so, how can i do it in perl?

try this:

use Socket;
$str_iaddr = "207.46.230.219";
$iaddr = inet_aton($str_iaddr);
$name  = gethostbyaddr($iaddr, AF_INET);
print $str_iaddr. " = " . $name;

--
 Lindsay Evans.
 Developer,
 Red Square Productions.

 [p] 8596.4000
 [f] 8596.4001
 [w] www.redsquare.com.au




More information about the thelist mailing list