my $hostname = 'yahoo.com'; my $ip = gethostbyname($hostname); print "$ip\n";