From owner-freebsd-questions@FreeBSD.ORG Sat Jul 3 04:44:14 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A74216A4CE for ; Sat, 3 Jul 2004 04:44:14 +0000 (GMT) Received: from pursued-with.net (adsl-66-125-9-244.dsl.sndg02.pacbell.net [66.125.9.244]) by mx1.FreeBSD.org (Postfix) with ESMTP id 258DC43D5A for ; Sat, 3 Jul 2004 04:44:14 +0000 (GMT) (envelope-from freebsd@pursued-with.net) Received: from [10.0.1.101] (unknown [10.0.1.101]) by pursued-with.net (Postfix) with ESMTP id 914671BBA06; Fri, 2 Jul 2004 21:45:38 -0700 (PDT) In-Reply-To: <40E62A8C.1040908@davidfuchs.ca> References: <40E62A8C.1040908@davidfuchs.ca> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Kevin Stevens Date: Fri, 2 Jul 2004 21:44:46 -0700 To: David Fuchs X-Mailer: Apple Mail (2.618) cc: freebsd-questions@freebsd.org Subject: Re: [Fwd: /etc/hosts and /etc/host.conf confusion] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jul 2004 04:44:14 -0000 On Jul 2, 2004, at 20:39, David Fuchs wrote: > # $FreeBSD: src/etc/host.conf,v 1.6 1999/08/27 23:23:41 peter Exp $ > # First try the /etc/hosts file > hosts > # Now try the nameserver next. > bind > # If you have YP/NIS configured, uncomment the next line > # nis That's typical. > Considering that 'hosts' is listed first, I would expect that any > entries I add to /etc/hosts will take precedence over entries > retrieved from bind. So, I added an entry to this file for a random > IP-to-name mapping, and tested it with the 'host(1)' command, and it > failed. When I enable debugging, it clearly shows that it's > consulting the first nameserver listed in resolv.conf (an external > host), no mention of a hosts file anywhere (or attempt to send a > request to the local host) Try ping; even if the host isn't available you can see if it resolves. "host" does it's own thing, which is sometimes non-obvious (to me at least). Look at the sections in man host about the variables it expects to be configured. > Additionally, what classifies as 'when the name server is not running' > - does this mean that /etc/hosts is used when all the nameservers > listed in /etc/resolv.conf are unavailable? (As I only use the local > named(8) daemon to host my personal domain, not for everyday recursive > lookups.) Or does it literally refer to when my local copy of > named(8) is not in the process list? The latter. For example, many workstations aren't configured to run named at all; they'll still reference their local hosts file. KeS