Problem, possibly new for 2.2.0, with lmhosts

Andrew Bartlett abartlet at pcug.org.au
Wed May 23 12:38:35 GMT 2001


David Collier-Brown wrote:
> 
>   One of my sites has a problem with clients being unable
> to resolve the right addresses from a Samba WINS server when
> connecting from a Win9x system, as well as nmblookup.
> 
>   The WINS server has an lmhosts file containing
> --
> 129.158.132.99  sunlight1
> 129.158.11.62   jimjim1
> --
> 
> The smb.conf on the WINS server says:
> ---
> We set the samba server to be a WINS server with the following
> configuration parameters (among others - see attached for all the
> files):
> 
>         wins support = Yes
>         wins proxy = Yes
>         dns proxy = yes
>         name resolve order = lmhosts host wins bcast
>         local master = yes
>         os level = 233
>         preferred master = True
>         domain master = True
> ---
> 
>   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.

> 
>   The behavior we see with smblookup and the win9x client is
> the one we'd expect from under smbd -H:
> ---
> ./nmblookup -R -U homer sunlight1
> INFO: Debug class all level = 2   (pid 22783 from pid 22783)
> added interface ip=129.158.18.85 bcast=129.158.18.255
> nmask=255.255.255.0
> querying sunlight1 on 129.158.11.26
> name_query failed to find name sunlight1
> ---
> 
>   If this is intentional (and it may be), what's the use of
> a name resolve order option that doesn't affect the services
> that nmbd actually provides? Anyone recollect a reason, or is
> this an oversight (i.e., a bug (;-))

It is used by the client components of the samba suite, including smbd
when it is acting as a client.  It does not affect nmbd (as stated) nor
reverse DNS (for the record).

Do you expect /etc/hosts to affect the way DNS operates?  My
understanding is that lmhosts files are the same idea, for purely local
consumption.

I think you can use static WINS entries for the desired effect, and I
don't think this is new, in that I remember similar questions in the
past.

In any case, this is my understanding of the issue.

Andrew Bartlett

-- 
Andrew Bartlett
abartlet at pcug.org.au




More information about the samba-technical mailing list