#!/usr/bin/perl -w use strict; use Socket; foreach my $ip (@ARGV) { my $sin = inet_aton($ip); my $name = gethostbyaddr $sin, AF_INET; print "$ip => $name\n"; }