<p>We are experiencing an issue with the jcifs client when trying to extract data from a DFS share under the following circumstances:<br>We have a subdomain of <a href="http://sub.domain.com">sub.domain.com</a> that has 40+ domain controllers.  Not all domain controllers are hosting the DFS root (does not have local DFS shares).  Only a subset of 10 or so do.  Accessing the domain based DFS could potentially hit any of these 40 domain controllers from the client.  When the domain controller referred to the client by DNS does not host the DFS root we encounter an error (more on the error below).  When the domain controller referred to the client by DNS does host the DFS root everything works as expected.  Since DNS can return any of the domain controllers this results in inconsistent behavior.  <br>
 <br>Note I am about 80% sure that this is what is happening. The only way we could test this was by modifying the hosts file and hardcoding the subdomain to point to the different domain controllers directly.  I realize that this is not a 100% replication of the entire live process but it supports my theory.<br>
 <br>Below is a chunk of a trace file from a failed attempt (referred to a domain controller not hosting the DFS root):<br> <br>1373 20:15:56 2011/5/3       32.919983           {TCP:41, IPv4:40} 130.226.187.2     130.226.185.3     SMB  SMB:C; Tree Connect Andx, Path = <a href="file://sub.domain.com/IPC$">\\sub.domain.com\IPC$</a>, Service = ?????<br>
1374 20:15:56 2011/5/3       32.920355           {TCP:41, IPv4:40} 130.226.185.3     130.226.187.2     SMB  SMB:R; Tree Connect Andx, Service = IPC<br>1375 20:15:56 2011/5/3       32.921955           {SMB:42, TCP:41, IPv4:40}     130.226.187.2     130.226.185.3     DFS   DFS:Get DFS Referral Request, FileName: <empty>, MaxReferralLevel: 3<br>
1376 20:15:56 2011/5/3       32.922452           {SMB:42, TCP:41, IPv4:40}     130.226.185.3     130.226.187.2     SMB  SMB:R; InterimResponse; Transact2, Get Dfs Referral - NT Status: System - Warning, Code = (5) STATUS_BUFFER_OVERFLOW<br>
1377 20:15:56 2011/5/3       32.923334           {TCP:41, IPv4:40} 130.226.187.2     130.226.185.3     SMB  SMB:C; Tree Connect Andx, Path = <a href="file://sub.domain.com/DFS">\\sub.domain.com\DFS</a>, Service = ?????<br>
1378 20:15:56 2011/5/3       32.923697           {TCP:41, IPv4:40} 130.226.185.3     130.226.187.2     SMB  SMB:R; Tree Connect Andx - NT Status: System - Error, Code = (204) STATUS_BAD_NETWORK_NAME</p>
<p>According to Microsoft Support, packet 1375 looks strange as the filename is empty in the DFS referral request.  Then, the client apparently treats the DFS path as a normal UNC path and receives a STATUS_BAD_NETWORK_NAME (packet 1377-78).<br>
 <br>Again according to Microsoft support the filename for the first DFS referral request should be populated with the domain name, something like "\<a href="http://sub.domain.com">sub.domain.com</a>" and the next should be the DFS root and so on...<br>
 <br>Any ideas on something we may be doing wrong or some piece of configuration we are missing?  Should jcifs be able to resolve DFS referrals on domain controllers that do not necessarily host the DFS root?<br> <br>Thanks,<br>
Andrew</p>