Hiyas

I've written a script that parses the error_log of apache for different
things, like attempts of CodeRed, stats on 'file not found' etc.
Everything works fine, from the extraction of the clients ip, to date
etc. I've come as far as doing reverse DNS lookups for the IP's, and for
this I use the module 'Socket', and the command

        [example of what I use (not exact replica)]
        #!/usr/bin/perl

        $ip = "xxx.xxx.xxx.xxx";
        $hostname = gethostbyaddr(inet_aton($ip), AF_INET);
        print "Hostname for $ip is: $hostname\n";
        

and then push the hostname for each unique IP into a hash table. My only
problem, is that I run this script from a few hosts that have extremely
slow responding nameservers. I've written in a simple cache function
for already resolved IP's, but I want the performance even better.

How would I go about to set for example a timeout setting for how long
the script should wait for a response, and is it possible to do more
than one DNS query at the time? Any suggestions and/or ideas would be
very much appriciated.

Thanks in advance.

-- 
########################################################################
#         Yours sincerely Jostein Elvaker Haande - aka tolecnal        #
#      E-mail: [EMAIL PROTECTED] - Web: http://www.thebios.com      #
#   CCNA Student - MOUS Certificate holder - PHP/PERL/TCL programmer   #
########################################################################


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to