in reply to testing for ip resolutions of a hostname
Do some error checking in your lookups. Makes life much simpler, IMHO.
#!/usr/bin/perl -w use strict; use Socket; my $host = "noresolve"; my $i = gethostbyname($host) or die "Failure to resolve $host: $!\n"; my $ip = inet_ntoa($i) or die "Failure to resolve $host: $!\n";
HTH
--
idnopheq
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: testing for ip resolutions of a hostname
by c (Hermit) on Aug 28, 2001 at 22:01 UTC | |
by idnopheq (Chaplain) on Aug 28, 2001 at 22:10 UTC |