#! /usr/bin/perl -w use strict; use Socket; while( <> ) { chomp; my $ip; if( $ip = gethostbyname( $_ )) { print "$_ resolves to " . inet_ntoa($ip) . "\n"; } else { print "$_ has no DNS information\n"; } }