Forward and Reverse DNS Lookups

Hostname to IP:
perl -MSocket -lne 'print "$_: ", eval { inet_ntoa inet_aton $_ }' sites.txt
IP to hostname:
perl -MSocket -lne 'print "$_: ", scalar gethostbyaddr( inet_aton( $_ ), AF_INET )' ips.txt

No comments:

Post a Comment