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