Date: Wed, 14 Nov 2001 20:20:39 -0500 From: The Anarcat <anarcat@anarcat.dyndns.org> To: FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: can't do reverse dns with /etc/hosts Message-ID: <20011115012039.GA61093@shall.anarcat.dyndns.org>
next in thread | raw e-mail | index | archive | help
--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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011115012039.GA61093>