I want to get the Active Directory site of a hosting a file given the UNC path. The LDAP tree is kind of big and contains multiple domains and sub-domains. What I was doing was parsing the path and obtaining the machine name. From there, I can get the IP and query AD to get the AD site getting the IP ranges from the subnets. This works OK as long as the target server is just a simple Windows computer with a shared folder.
However, I'm encountering issues with DFS domain based shares. Getting the machine name doesn't work, as what you are getting is the DFS domain controller and the IP can change dynamically depending on the root target it assigns each time. I have no idea how to solve this. I would appreciate any solution either querying Active Directory, getting information from the DFS server somehow, using JCIFS or any other option. Also I would like to know if there's any way we can identify the UNC path belongs to a DFS share. Just to add more complexity, we cannot use the Windows .NET DFS API as the application runs with Java in Linux.
Thanks in advance.