#!/usr/bin/perl -w use Socket; $IP = "129.21.30.99"; # inet_aton returns an "opaque string" C struct # that is passed to the system call. $IPaddr = inet_aton( $IP ); # AF_INET means that we're interested in Internet objects # rather than Unix file system objects (AF_UNIX). $hostName = gethostbyaddr( $IPaddr, AF_INET ); print "$IP: $hostName\n";