Before any domain logon, Group Policy update or Kerberos ticket, a Windows machine has to answer one question: which domain controller should I talk to? The process that answers it is the DC locator, run by the Netlogon service. When it picks a DC on the other side of the world, logons are slow; when it finds none, nothing works.
The ingredients
- DNS SRV records. Each DC’s Netlogon service registers records that say “I’m a DC for this domain, in this site”. You can see the full list a DC tries to register in
%SystemRoot%\System32\config\netlogon.dns. - AD sites and subnets. In Active Directory Sites and Services you map IP subnets to sites. That’s how a DC knows which site a client is in.
- The client’s cached site. Each machine remembers the last site it was told it’s in.
Key SRV records:
| Record | Finds |
|---|---|
_ldap._tcp.dc._msdcs.contoso.local |
Any DC in the domain |
_ldap._tcp.<Site>._sites.dc._msdcs.contoso.local |
DCs in a specific site |
_kerberos._tcp.dc._msdcs.contoso.local |
DCs running the KDC |
_ldap._tcp.gc._msdcs.contoso.local |
Global catalog servers |
_ldap._tcp.pdc._msdcs.contoso.local |
The PDC emulator |
Step by step
- Ask DNS for the site-specific SRV record using the cached site (or the domain-wide record if it doesn’t know one).
- DNS returns a list of DCs with priority and weight.
- LDAP ping – the client sends a small connectionless LDAP query (UDP 389) to the DCs.
- The first DC to reply wins. In its reply, the DC also tells the client which site its IP address belongs to. If that’s a different site, the client repeats the search in the correct site.
- The client caches the DC and its site and uses them until something fails or it’s asked to find a new one.
See it for yourself
nltest /dsgetdc:contoso.local # which DC and site this machine is using
nltest /dsgetsite # this machine's site
nltest /dsgetdc:contoso.local /force # find a DC again, ignoring the cache
Resolve-DnsName -Type SRV _ldap._tcp.dc._msdcs.contoso.local
Resolve-DnsName -Type SRV "_ldap._tcp.Chennai._sites.dc._msdcs.contoso.local"
When it goes wrong
“No domain controller could be contacted” / can’t join the domain
- The client isn’t using AD DNS servers (a public DNS or a router as DNS is the most common cause). Check
Get-DnsClientServerAddress. - The SRV records are missing. On a DC, restart Netlogon or run
nltest /dsregdnsto re-register, and check DNS for the_msdcszone. - A firewall blocks UDP/TCP 389, 88 or 53 to the DCs.
Slow logons in a branch office
- The branch’s subnet isn’t defined in AD, so the client gets a random DC – maybe in another country. DCs log NETLOGON event 5807 about clients from undefined subnets, and the details are in
%SystemRoot%\debug\netlogon.log(look forNO_CLIENT_SITE). - Fix: add the subnet and map it to the right site.
Everyone hits one DC
- Check SRV priority/weight, and whether the other DCs registered their site-specific records.
Good practice
- Define every subnet (including VPN and cloud ranges) in Sites and Services.
- Point clients only at AD-integrated DNS servers; forward internet names from there.
- Keep at least two DCs per important site, or make sure the nearest site is reachable cheaply.
What’s next
Next: Active Directory replication explained.
Practise this topic
Test yourself with free questions on this topic – instant answers and explanations.
Start practice questionsWindows ServerActive DirectoryDNSSitesDeep DiveAdvanced