Configuring an Active Directory authentication source works as expected when the Domain Controller is specified directly in the configuration.
However, when the Auto option is specified as per the screenshot below, the test connection fails with the error:
Test unsuccessful for ldap: <Domain Controller FQDN>. Host Unreachable. Reason: SocketTimeoutException: connect timed out
When the Auto option is configured for the Host field, a DNS query is made to retrieve the list of domain controllers hosts and ports from DNS SRV records.
The DNS SRV configuration can be verified with the following commands (replacing <example.com>):
nslookup -type=srv _ldap._tcp.<example.com>
nslookup -type=srv _gc._tcp.<example.com>