In a situation where vCenter has 2 DNS servers which are not in sync, domain logins to the vCenter server might fail for entries not present in the 2nd DNS server.
This is due to vCenter reaching out to the secondary DNS even though the primary DNS server is available.
Below snippet is observed in websso logs during a failed AD login:"cannot establish ldap connection with URI: [ldap://<server_name>:389] because [com.vmware.identity.interop.ldap.ServerDownLdapException] with reason [Can't contact LDAP server] therefore will try to attempt to use secondary URIs, if applicable".
This issue can cause intermittent AD User logins failure with an "invalid credentials" error.
vCenter Server 7.x
vCenter Server 8.x
systemd-resolved service.Add a flag to force the systemd-resolved service to prefer a particular DNS server.
This flag forces dnsmasq to try each query with each server strictly in the order they appear in /etc/resolv.conf.dnsmasq will only refer to the next server in the order only if the preferred one is unreachable.
To force the vCenter Server to always query the Primary DNS server if it is reachable:
vi /etc/dnsmasq.conflisten-address=127.0.0.1
bind-interfaces
user=dnsmasq
group=dnsmasq
no-negcache
no-hosts
log-queries
strict-order
log-facility=/var/log/vmware/dnsmasq.log
domain-needed
dns-forward-max=150
cache-size=8192
neg-ttl=3600
systemctl daemon-reloadsystemctl restart dnsmasq.serviceThis configuration is helpful in environments where some DNS entries are not defined in the Secondary Server, usually where the DNS Servers do not synchronize with each other.
Making the above changes makes sure that the queries for the entries are not forwarded to the secondary servers causing login failures for those accounts.