in reply to My IP address
Though your question might be about machines with multiple ip addresses.... can't really tell.#!/usr/bin/perl -wT use strict; use POSIX qw(uname); use IO::Socket; my $hostname = (uname)[1]; my $ipbin = gethostbyname($hostname) or die "Couldn't resolve $hostname : $!"; my $ip = inet_ntoa($ipbin); print "$hostname => $ip\n"; =output cobalt.blakem.com => 64.94.194.149
-Blake
|
|---|