Problem, possibly new for 2.2.0, with lmhosts

David Collier-Brown davecb at canada.sun.com
Wed May 23 12:04:05 GMT 2001


  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."

  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 (;-))

  Looking at the code, it's used only in internal_resolve_name(),
which is called by resolve_name(), find_master_ip() and get_dc_list(),
and resolve_name(0 is called by both cli_connect() and
resolve_srv_name(),
so the code seems to use it in the general case...

  If it's a bug, have we just introduced it?

--dave
David Collier-Brown,           | Always do right. This will gratify 
Performance & Engineering Team | some people and astonish the rest.
Americas Customer Engineering  |                      -- Mark Twain
(905) 415-2849                 | davecb at canada.sun.com




More information about the samba-technical mailing list