in reply to gethostbyname
A domain administrator can put in hostname-address pairs for addresses that don't exist. vroom or the administrator for perlmonks could put in "nosuchhost.perlmonks.org" at some address. This might be for testing. A name could also resolve to an address of a host that was offline becuse it was failing or down for maintenance. DNS, hosts, and NIS only return the mappings. This is probably from the traditional UNIX philosophy that a tool should do one thing and do it well. If you want to see if a host exists, try to access it. ping might work if it is not blocked at a firewall, but it might not.
HTH, --traveler
|
|---|