Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!topaz!hedrick From: hedrick@topaz.UUCP Newsgroups: comp.bugs.4bsd,comp.unix.wizards Subject: Re: By any other named Message-ID: <8837@topaz.RUTGERS.EDU> Date: Mon, 2-Feb-87 16:39:27 EST Article-I.D.: topaz.8837 Posted: Mon Feb 2 16:39:27 1987 Date-Received: Tue, 3-Feb-87 07:28:07 EST References: <515@aplvax.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 24 Xref: watmath comp.bugs.4bsd:167 comp.unix.wizards:789 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