[jcifs] Absence of 'automagical' WINS server resolution in jcifs when compared to smb/nmb/winbind

Christopher R. Hertel crh at ubiqx.mn.org
Fri Jul 22 19:56:24 GMT 2005

On Fri, Jul 22, 2005 at 02:46:44PM -0400, John Utz wrote:
> Hello jcif-rs!
> jcifs-1.11 works wonderfully if you provide it with some relatively
> explicit facts concerning WINS and the domain controller.
> in addition to the name of the domain, i need to correctly fill out
>  jcifs.netbios.wins 
> and 
>  jcifs.smb.client.domainController.
> I run smb/nmb/winbind on the same computer. I do not need to provide
> this information to these tools, they appear to discern these facts
> automagically.

I'm not sure how that would happen unless, perhaps, the information is
provided via DHCP.  It has been a while, but I vaguely recall someone
working on adding DHCP config support to Samba, but I can't see any
reference to it in the current docs so I don't know if it's really there.

Take a look at the smb.conf file.  If there's no WINS server specified
then my guess is that Samba is actually doing a DNS lookup.  My own
opinion is that using the DNS for NetBIOS name resolution is messy and
dangerous, but Windows does it so Samba does it too.

> Is there some way that i can configure jcifs to behave more like samba
> in this respect?

Find out first how Samba is getting the information.  Either the NBNS
(WINS server) IP is in the smb.conf file, or Samba is using the DNS.

> Placing ip information in configuration files that are located on each 
> and every jcifs machine in the domain seems rather brittle.

That's how Windows typically does it.  You generally configure each and
every Windows box either with a static WINS server IP address, or to
accept whatever WINS server (NBNS) address the system is handed via DHCP.

> If forces outside of my  control decide to change the name of the 
> domainController or the IP of the wins server, then all my jcifs boxes 
> are broken, and nobody will be able to login to fix it because they wont 
> be validated against the domain :-(

Likewise for Windows (unless you're using DHCP and they also update the
DHCP server),

As for the DC, there are a couple of protocols for finding a domain 
controller.  jCIFS can use simple name lookups to find a DC, assuming 
NetBIOS name resolution is working.  The other protocols require RAP or 

> Am i correct in my understanding of how this works?

Not really.  :)

...but you seem to have enough clue to figure it out.

I wrote a whole book on the subject, if you're interested.  The book's
online and link is in my signature, below.

> Is this a subject that has been pondered by the jcifs developers? Is 
> this an explicit design decision? or is this a bug that needs fixing?

It is important that jCIFS not be made reliant on things like the location 
of the DHCP client leases file, etc.  Personally, I do wish that there 
were an easy way to find the NBNS, but the only way to do that is:

- Find one or more Local Master Browser nodes on the local network (NBT
  can't see outside of the local IP subnet unless it knows where the NSNS 
  (aka. WINS server) is).

- Collect browse lists from any/all of the LMBs you've discovered.

- Search through those lists to find entries with the WINS bit set.

That's not a sure-fire approach, however.  The WINS server(s) you find may 
not be correct for the set of machines you want to access.  It is also 
completely possible that the NBNS isn't running any services, in which 
case it won't register with the Browse Service.

Fun, eh?

Chris -)-----

"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org

More information about the jcifs mailing list