From owner-freebsd-questions Wed Nov 14 17:19:37 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tomts12-srv.bellnexxia.net (tomts12.bellnexxia.net [209.226.175.56]) by hub.freebsd.org (Postfix) with ESMTP id 18AF437B405 for ; Wed, 14 Nov 2001 17:19:34 -0800 (PST) Received: from khan.anarcat.dyndns.org ([65.94.145.25]) by tomts12-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011115011932.NNRM3045.tomts12-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Wed, 14 Nov 2001 20:19:32 -0500 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 9FC2A19C7 for ; Wed, 14 Nov 2001 20:19:39 -0500 (EST) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 4D95320AD0; Wed, 14 Nov 2001 20:20:39 -0500 (EST) Date: Wed, 14 Nov 2001 20:20:39 -0500 From: The Anarcat To: FreeBSD Questions Subject: can't do reverse dns with /etc/hosts Message-ID: <20011115012039.GA61093@shall.anarcat.dyndns.org> Mail-Followup-To: The Anarcat , FreeBSD Questions Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline User-Agent: Mutt/1.3.23.2i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I stumbled upon a slight problem recently. I always figured using a nameserver was a good idea for my local network so I had one setup for quite a while.. However, my router doesn't talk to the nameserver for security reasons. (the nameserver takes care of the *local* DNS setup.) Now, I figured that if I put a few entries in /etc/hosts on that router, it won't really need to consult the DNS anyways. The entries are in place, but it doesn't work. On a test machine, I discover that bypassing the nameserver to do reverse queries simply breaks them. Example, with the nameserver in resolv.conf: anarcat@shall[~]% host 10.0.0.1 1.0.0.10.IN-ADDR.ARPA domain name pointer foo.anarcat.dyndns.org anarcat@shall[~]%=20 All nice and easy. Now, I enter a proper line (?) in /etc/hosts to replace that: 10.0.0.1 foo.anarcat.dyndns.org foo I *remove* resolv.conf (since turning "bind" off in /etc/host.conf doesn't seem to be enough!) and I get: anarcat@shall[~]% host 10.0.0.1 Host not found, try again. anarcat@shall[~]%=20 What the? At first I tought /etc/hosts didn't allow reverse lookups, but after a bit of reading in /usr/src (lib/libc/net/gethostbyht.c is an interesting reading :), I realise that it *did* allow reverse lookups... I am now confused. Is my setup correct? What do I do wrong? I'm running 4.4-stable. Thanks. A. --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjvzGGUACgkQttcWHAnWiGd19gCZAfVapBY0p9B+2nLJe3HJpYm4 T+gAn2E+PLfANH19noQpGkAKLkAjvYoX =n1Uw -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message