Problem, possibly new for 2.2.0, with lmhosts

Steve Langasek vorlon at
Wed May 23 14:15:08 GMT 2001

On Wed, 23 May 2001, Tony Shepherd wrote:

> Andrew Bartlett wrote:

> > >   What we expected to happen is that the wins server would
> > > attempt to discover the address, fail to find it in dns
> > > (dns proxy) but would find it in lmhosts.  This is not at
> > > all what happens.

> > >   On re-reading the caveats on -H in the nmbd(8) man page, I see that
> > > it says "this file are NOT used by nmbd to answer any name
> > > queries. Adding a line to this file affects name NetBIOS resolution
> > > from this host ONLY.".
> > >   I'm puzzled: this caveat isn't in smb.conf(5), which says that
> > > "This option is used by the programs in the Samba suite to determine
> > > what naming services to use and in what order to resolve host names
> > > to IP addresses."

> > But only when samba is operating as a client, /etc/resolv.conf and
> > /etc/nsswitch.conf don't affect DNS do they?  I think this is the same
> > idea.

> but if the resolv.conf file says to search in order files dns, it at
> least looks at the entries contained in the /etc/hosts file when I try
> and connect using telnet to a site "jim".  In this case, telnet is the
> client, and /etc/hosts provides the imformation.  This is what I would
> have expected to happen in the case of using lmhosts

But the *DNS server* that you're running on your machine does not use
/etc/hosts when responding to DNS requests from other machines.  Clients on
the local machine use /etc/hosts; nothing else does.

The use of lmhosts is nicely parallel to this, and quite by design.  It's also
what Microsoft does.  If you want your WINS server to advertise names that are
configured statically in a config file, then you need static WINS entries, not
lmhosts entries.  There are good reasons why both types of records are needed,
and why they are kept separate.

Unfortunately, I don't believe nmbd implements static WINS entries at this
time.  At the very least, it doesn't seem to be documented anywhere obvious.

If someone were going to implement this, I would suggest using a separate
config file in $(sysconfdir) that gets pulled into wins.dat by nmbd on startup
(with an appropriate flag to indicate the entries are static).  This ensures
that the static entries survive events such as corruption of wins.dat or the
occasional rogue deletion by an administrator.

Steve Langasek
postmodern programmer

More information about the samba-technical mailing list