in reply to Re: gethostbyname not working
in thread gethostbyname not working
This gets me further, when I print them out however, I
get numbers that are no relative the the IP address, or
even close.
for instance, yahoo.com
This prints out: 121.97.104.111
which is not even close to yahoo's IP (I know yahoo has a large subnet, but this doesn't even start with the same number). Any ideas?
my $hostname = 'yahoo.com'; my $addr = (gethostbyname($hostname))[0]; my ($a,$b,$c,$d) = unpack('C4',$addr); print "$a.$b.$c.$d\n";
This prints out: 121.97.104.111
which is not even close to yahoo's IP (I know yahoo has a large subnet, but this doesn't even start with the same number). Any ideas?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: gethostbyname not working
by tadman (Prior) on Mar 27, 2001 at 18:19 UTC | |
Re: Re: Re: gethostbyname not working
by myocom (Deacon) on Mar 26, 2001 at 21:18 UTC |
In Section
Seekers of Perl Wisdom