in reply to resolving ip's to names in a text file

I don't know if this is what you mean, but it's worked for me a few times. This works on SunOS very well (the foratting may be different based on the OS -- im not much of a networking guy :) )

#!/usr/bin/perl -w $ipaddressfile = "FILENAME-TO-PLAINTEXT-IPADDRESS-FILE"; @iplist = ""; $i = 0; open(IPLISTFILE,"<$ipaddressfile"); while(<IPLISTFILE>) { $iplist[$i] = $_; $i++; } close(IPLISTFILE)l foreach $ipaddr (@iplist) { @ns = `nslookup $ipaddr`; $ns[3] =~ m%.* (.*)%; print $ipaddr . " resolves to " . $1 . "\n"; }

Replies are listed 'Best First'.
Re: Re: resolving ip's to names in a text file
by RayRay459 (Pilgrim) on Jul 20, 2001 at 19:52 UTC
    I'll see if i can get this to work for me as well. Thank you anonymous monk. ~Ray~