From owner-freebsd-net@FreeBSD.ORG Thu Sep 13 03:33:55 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6856716A419 for ; Thu, 13 Sep 2007 03:33:55 +0000 (UTC) (envelope-from oceanare@pacific.net.sg) Received: from smtpgate1.pacific.net.sg (smtpgate1.pacific.net.sg [203.120.90.31]) by mx1.freebsd.org (Postfix) with SMTP id A106F13C458 for ; Thu, 13 Sep 2007 03:33:54 +0000 (UTC) (envelope-from oceanare@pacific.net.sg) Received: (qmail 26448 invoked from network); 13 Sep 2007 03:33:52 -0000 Received: from bb121-7-106-120.singnet.com.sg (HELO P2120.somewherefaraway.com) (oceanare@121.7.106.120) by smtpgate1.pacific.net.sg with ESMTPA; 13 Sep 2007 03:33:52 -0000 Message-ID: <46E8AF9C.3060107@pacific.net.sg> Date: Thu, 13 Sep 2007 11:33:48 +0800 From: Erich Dollansky User-Agent: Thunderbird 2.0.0.6 (X11/20070826) MIME-Version: 1.0 To: d@delphij.net References: <46E8AB2E.7020602@delphij.net> In-Reply-To: <46E8AB2E.7020602@delphij.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net Subject: Re: [nsdispatch] hosts(5) does not override DNS lookup? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2007 03:33:55 -0000 Hi, I have had the same behaviour. LI Xin wrote: > > Recently one of our local user has found that he was unable to use > hosts(5) to override "localhost" lookup that happens in DNS, while doing > rpc_clnt_create. A preliminary investigate of this seems to be related > to nsdispatch, by replacing: > > hosts: files dns > > With: > > hosts: files > > in /etc/nsswitch.conf, it does not query DNS. > > Before diving into NSSWITCH code, I'd like to know if this is expected > behavior? Say, when we have a match in hosts(5), should we even bother > to query DNS if configured hosts: files dns? > After getting a hint on the list, I found out that some strange characters in hosts made the file useless. After retyping hosts, hosts was accepted again. I was not able to find out what character it was. I expected CR, but it was not the case. Just retype or copy it from a working system. Erich