By any other named

hedrick at topaz.UUCP hedrick at topaz.UUCP
Tue Feb 3 07:39:27 AEST 1987


You complain that gethostbyname uses /etc/host when its attempt to
find named is refused but not when it times out.  You suggest that
it should use /etc/host for either a connection refused or a timeout.
Unfortunately, this would lead to incorrect results.  In practice
connection refused means that you reached the host, but it was not
running named.  A timeout means that you were unable to reach the
host, presumably because it was down or some gateway between you
was down.  If you reach the server and it is not running named, this
would seem to be a permanent problem, and it would seem reasonable
to try a different approach.  However if you can't reach the server
at all, it is better to wait until it comes up.  The problem with
going to /etc/host is that in general /etc/host doesn't contain 
all of the hosts.  So by going to it, you may reject a request, and
for example bounce somebody's mail, claiming "no such host".  It is
better to wait until the nameserver comes back up than to use a
database that is known to be incomplete, and in some cases even
wrong.  In my opinion, the right solution is that people who are
don't want to use named should do one of the following:
  - use the version of gethostbyname that doesn't use named
  - set up /etc/resolv.conf to point to your loopback address
	(normally 127.0.0.1) and make sure that you are not running
	named.  Presumably you will never get a timeout when talking
	to yourself over the loopback address, so if you aren't
	running named, you should always get an immediate refusal



More information about the Comp.unix.wizards mailing list