Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 1996 22:17:51 +0100 (BST)
From:      Nik Clayton <nik@blueberry.co.uk>
To:        questions@freebsd.org
Cc:        nik@guava.blueberry.co.uk (Nik Clayton)
Subject:   NIS and usage of /etc/hosts
Message-ID:  <199605302117.WAA01200@guava.blueberry.co.uk>

next in thread | raw e-mail | index | archive | help
How do,

Short question: 

With NIS running on a local network, a name service running, but no 
reverse DNS, telnet'ing to another machine on the local network pauses for 
2 minutes will the in-addr.arpa lookups time out.  Why isn't the 
hosts.byaddr map used?

Long question (as above, but more depth, for those with time):

I've got two machines, A and B.

I'm in the process of installing NIS on the two of them. A is the master,
B is the client.

Up until I started doing this, both machines had identical /etc/passwd,
/etc/hosts and /etc/host.conf files.

I think I've got NIS running successfully. Certainly the passwd maps are
going across successfully, because I can login to B as one of the users on
A, when that user only exists in the NIS map, and definitely not on B's
/etc/passwd file.

I'm in the final throes of finishing this configuration. After reducing
the password file on B, I figured it was time to reduce the /etc/hosts
file as well.

So I pulled it down to it's bare essentials, namely an entry for 'localhost'
and an entry for 'B' itself.

Then I edited /etc/host.conf, and set the lookup order to

    hosts
    nis
    bind

My reasoning being 'use /etc/hosts for yourself and localhost, nis for 
anything on the local network, and the DNS for everything else' which 
seems sensible.

And now, telnetting from A to B takes 2 minutes longer than normal. If I
put a line for A into B's /etc/hosts file then I can telnet in straight
away. So far, this smells like a name resolution problem.

After theorising with a friend, we decided that telnetd (and others,
because this behaviour is exhibited with rlogin) is doing a reverse lookup
on A's IP address to get the name, to put it into things like {w,u}tmp and
the like. Because we don't have any reverse DNS (it's a long story)

Acting on this, I commented out the 'bind' entry in /etc/host.conf and
tried again. Our theory seems to be correct, as now A's IP address is put
into the {w,u}tmp records, and the connection starts at the usual speed.

Of course, now B can't do name lookups, which isn't very useful.

This feels like telnetd (and friends) aren't using the host.byaddr NIS map
to turn the IP address into a name. Why?

Or am I barking up completely the wrong tree?

N
-- 
--+=[ Blueberry Hill                   Blueberry Design                   ]=+--
--+=[ http://www.blueberry.co.uk/      1/9 Chelsea Harbour Design Centre, ]=+--
--+=[ WebMaster@blueberry.co.uk        London, England, SW10 0XE          ]=+--
--+=[ The Truth Is Out There: /usr/local/X11R6/lib/lib[X11|Xaw|Xpm|Xmu].a ]ENTP



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605302117.WAA01200>