Skip to content

Lesson 4 of 14 · 19m

Active Directory Is Three Services in One Trenchcoat

A DC answers LDAP, Kerberos, and GC traffic found via site-scoped SRV records — FSMO roles, USN replication, and why DNS health is AD health.

A DC is LDAP + Kerberos + DNS, and DNS finds it

A domain controller answers LDAP on 389 (LDAPS on 636), Kerberos on 88, the Global Catalog on 3268, and SMB for SYSVOL — and none of it works unless DNS answers first. A domain-joined machine locates a DC by querying SRV _ldap._tcp.<site>._sites.dc._msdcs.<domain>; the site scoping exists so authentication doesn't cross a WAN link. When someone says "AD is down," the first checks are nltest /dsgetdc:contoso.local and the DNS answer — not the DCs themselves.

The mental model to kill: "AD is a user database with a GUI." It's a replicated LDAP directory — the DIT lives in NTDS.dit on every DC — split into naming contexts: Schema for object definitions, Configuration for sites, subnets, and replication topology, Domain for the users, groups, computers, and OUs you think of as "AD," and application partitions like DomainDNSZones when DNS is AD-integrated. Kerberos is the authentication protocol bolted onto it; the DC is the KDC.

Five jobs that aren't shared

Normal replication is multi-master — any DC accepts writes and the changes converge. But five operations are single-master, held by FSMO roles:

  • Schema Master and Domain Naming Master (one each per forest): schema extensions, adding and removing domains.
  • RID Master (per domain): hands each DC blocks of 500 RIDs to mint SIDs from. A DC that can't reach the RID master when its pool runs dry stops creating objects — the failure that looks like random "access denied" on user creation.
  • Infrastructure Master (per domain): tracks cross-domain phantom references.
  • PDC Emulator (per domain): the forest's time authority (DCs sync from it, clients sync from their DC — w32tm), the arbiter for account lockouts, and the target of urgent replication when a password changes.

netdom query fsmo shows the holders; move them with Move-ADDirectoryServerOperationMasterRole. When a DC dies hard, you seize them with -Force — and the old holder must never come back online, because two FSMO holders is a forest-level corruption event.

The Global Catalog deserves its own note: it's the subset of every domain's objects used for forest-wide searches, and in a multi-domain forest a DC that isn't a GC can't complete a logon that involves universal groups — universal group membership is only resolvable through the GC. Every DC in a single-domain forest can be a GC safely; in multi-domain forests it's the default that saves you.

Replication, briefly

Intra-site replication is change-notification based — roughly fifteen seconds. Inter-site runs on the site-link schedule, default every 180 minutes, over RPC using the DRSUAPI protocol. Everything is tracked by USN stamps and per-attribute versions: multi-master conflicts resolve last-writer-wins per attribute, not per object. Deleted objects become tombstones, kept 180 days.

Two operational truths follow. First, repadmin /showrepl and repadmin /replsummary are the answer to "is replication healthy" — run them before any AD change and after any DC outage. Second, never snapshot-restore a DC: rolling back USNs creates lingering objects that corrupt the forest quietly. Server 2012+ added VM-Generation-ID safeguards that make virtualized DCs detect the rewind — verify your hypervisor honors them before you trust a snapshot.

Sites aren't optional decoration either: subnet objects mapped to site names are what make dc._msdcs lookups site-aware, and site links (with their costs and schedules) drive both client DC selection and the replication topology the KCC builds — the bridgehead selection is automatic via the ISTG. A subnet nobody declared gets clients authenticating to a DC on another continent, which reads to users as "the network is slow at 9am."

Real-world stakes: CVE-2020-1472 — Zerologon — let a network-adjacent attacker set a DC's own machine password to empty through the Netlogon RPC protocol and take the entire domain. The DC is both the directory and the credential issuer. That's why "patch DCs first" is doctrine, why the AD Recycle Bin (forest functional level 2008 R2+, enable it once with Enable-ADOptionalFeature) is worth turning on before you need it — it makes deleted-object restore authoritative instead of a tombstone reanimation — and why a read-only DC (RODC) exists for branch offices you don't physically trust: it holds no writable secrets and caches only the passwords you explicitly allow.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.