From owner-freebsd-questions Sun Nov 14 9:12:30 1999 Delivered-To: freebsd-questions@freebsd.org Received: from laurasia.com.au (lauras.lnk.telstra.net [139.130.93.142]) by hub.freebsd.org (Postfix) with ESMTP id 6E39E14A27 for ; Sun, 14 Nov 1999 09:12:05 -0800 (PST) (envelope-from mike@laurasia.com.au) Received: (from mike@localhost) by laurasia.com.au (8.9.1a/8.9.1) id BAA26155; Mon, 15 Nov 1999 01:06:50 +0800 (WST) From: Michael Kennett Message-Id: <199911141706.BAA26155@laurasia.com.au> Subject: Re: DNS and resolv.conf In-Reply-To: <382E8511.67F02855@sinclairassoc.force9.co.uk> from Richard Morte at "Nov 14, 99 09:46:57 am" To: ric@sinclairassoc.force9.co.uk (Richard Morte) Date: Mon, 15 Nov 1999 01:06:50 +0800 (WST) Cc: freebsd-questions@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi Richard, I'm sure you've read the resolv.conf (5) man page already. Anyway, the effect of an empty resolv.conf file is: 1. Assume nameserver == 127.0.0.1 (localhost) 2. Extract 'domain' name from the gethostname (3) system call 3. 'lookup' order is `bind file' i.e. An equivalent resolv.conf file for you should be: nameserver 127.0.0.1 domain at.home lookup bind file (My personal preference is to explicitly list the defaults in a config file. My resolv.conf file is pretty much as shown above (with different domain)) I don't know what your problem is exactly, but could you provide the following information: [stuff related to resolv.conf] 1) The output of the 'hostname' command 2) The contents of the /etc/hosts file [stuff related to DNS] 3) The contents of the /etc/namedb/named.conf file [random stuff: see hostname (7)] 4) The value of the environment variable HOSTALIASES (if set) [ppp (8) connection] 5) Do you have the 'enable dns' command in your ppp.conf file? (assuming you are using ppp) If you'll allow me the indulgence of making gratuitous assumptions below, I'll try and walk thru' what I think is part of the problem: In your problem description, you stated that you removed the 'forwarders' line from the named.conf file (I think this is a *BAD* thing to do). So I'm not sure how *any* external name lookup can succeed, unless you have the 'enable dns' command in your ppp.conf configuration file. Now, (assuming no forwarders entry in named.conf), the lookup of the name home.netscape.com will proceed as follows (I think): 1. Try the DNS system a) Try the name home.netscape.com ### FAIL -- no forwarders active <---- would initiate a dialout b) Try the name home.netscape.com.at.home ### FAIL -- nonsense name 2. Try the /etc/hosts file a) Try the name home.netscape.com ### FAIL So if you are not connected to the net, a lookup of the name home.netscape.com should *fail* (can you confirm this?). I think this explains the appearance of the home.netscape.com.at.home lookups as well. A possible remedy to your problems would be add the line: lookup file bind to your /etc/resolv.conf file, and to use the /etc/hosts file to list the names and addresses of all your local (at.home) machines: 192.168.120.1 machine1 machine1.at.home 192.168.120.2 machine2 machine2.at.home etc... This effectively by-passes the DNS system for local name lookups, and would allow you to re-enable the forwarders entries in named.conf. By looking up local names first, the spurious dialouts on name lookups should be stopped. Final comments: Note that the nslookup (8) command does *not* use the resolver libraries. It talks directly to the named daemon. A better test is to try the ping command -- it uses the resolver routines, and hence, the searching order done above. Hope this helps. Please provide the information requested above, and we can hopefully solve the problem completely, Regards, Mike Kennett (mike@laurasia.com.au) Richard asked: > I had a single entry in resolv.conf : > domain at.home > > but removed this because I kept seeing entries such as > 'home.netscape.com.at.home' in the named logs. All seemed well for about > a week. Now I see 'at.home' appended occasionally to DNS lookups outside > the local subnet. Testing the DNS with nslookup works fine every time > for both local(private) and internet-wide names and addresses. > I have named running on a local server with private subnet 192.168.120 > > DNS has been working fine for over a month now, but recently I have > started getting error messages ('cannot connect to host') when _first_ > connecting to the internet and when first accessing mail accounts at our > ISP. A 2nd try always succeeds in resolving a name to IP address. > > I had a single entry in resolv.conf : > domain at.home > > but removed this because I kept seeing entries such as > 'home.netscape.com.at.home' in the named logs. All seemed well for about > a week. Now I see 'at.home' appended occasionally to DNS lookups outside > the local subnet. Testing the DNS with nslookup works fine every time > for both local(private) and internet-wide names and addresses. > > I am wondering if the problem lies with resolv.conf? > > I have had various entries in there at one time or another. I deleted > the DNS entries (forwarders) for our ISP some time ago because it seemed > to cause numerous spontaneous dialups. After deleting these entries the > dialups ceased. > > Now that I have deleted the 'domain' entry, resolv.conf is empty. > > So just what should go in there? > > Regards, > > Ric To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message