#!/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"; }
In reply to Re: resolving ip's to names in a text file
by Anonymous Monk
in thread resolving ip's to names in a text file
by RayRay459
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |