'adcli info' fails to locate appropriate DC for the client if it cannot get CLDAP response from some DCs
'adcli info' currently tries only five DCs in the whole domain. If for any reason it cannot talk to those five DCs then domain discovery fails, there is no site name or NetBIOS domain name in it's output.
In the case through which I discovered this issue a customer has a multi-site domain where clients are not allowed to talk directly to the DCs outside of their site. In this setup Windows machines are successfully performing DC location and joining the domain, but Linux fails to do the same unless explicitly given NetBIOS name of the domain and site.
I have prepared a patch (attached) that changes 'adcli info' behavior to be more resilient and similar to Windows NetLogon DC locator implementation, going through every DC it gets from SRV RRs until it finds the one that responds. I've added comments for the aspects of the patch that could be seen as more "controversial", hopefully they are all clear enough. Please let me know if the patch looks good to you, and if not - what issues in it you'd like me to address before you can accept it.
0001-Make-adcli-info-DC-location-mechanism-more-compliant.patch