[jcifs] SmbFile.exist: subnet, connection to domain controller

Michael B Allen ioplex at gmail.com
Tue Dec 8 15:33:09 MST 2009

On Tue, Dec 8, 2009 at 2:01 PM, Jean-Marc Autexier <jmau2002 at web.de> wrote:
> Hi,
> I'm connecting to a server in another network to check a file on a cifs
> share (using jcifs-1.3.12).
> I more or less just use SmbFile with
> "smb://DOMAIN;USER:PASSWORD@MYSERVER/share/myFile" and call exists();
> This works fine, except that even before connecting to the server MYSERVER
> SmbFile (or some other code in jcifs) tries to establish a connection to the
> server DOMAIN (this is from observing packets with wireshark), probably
> because somewhere it tries to retrieve the domain controller of the network.
> This happens also when MYSERVER is an IP address.
> In local networks this is probably no problem, but here I'm not allowed to
> connect to the DC of the other network (DOMAIN), only to the server
> Because it can't resolve the name of the server DOMAIN it takes few seconds
> (~8sec) until it get a timeout, than the smb connection to MYSERVER is
> established and everything is ok. So no error, it just takes way to long to
> check a file.
> I don't see any reason why packets are send to the DC when yxou just want to
> connect to a server. Probably it's just an address resolution which is done
> somewhere.
> Does someone has an idea why this happens and if it can be changed?

Hi Jean-Marc,

That communication with the DC is for DFS. If you use a fully
qualified DNS hostname I think JCIFS will not try to do the DFS root
referrals. You should always use a fully qualified DNS hostname anyway
to avoid common name service problems. But I'm not sure if that alone
will stop JCIFS from trying to do DFS. If this is the case, you can
set jcifs.smb.client.dfs.disabled = true in which case JCIFS should
not try to perform DFS root referrals.


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list