Skip to content
Tutorials Center
My learning

Topics

Lesson 33 of 38 ยท Administration

Replication, Sites, Subnets and FSMO Roles

Understand multi-master Active Directory replication: USNs and conflict resolution, sites, subnets and site links, the KCC, SYSVOL and DFSR, the five FSMO roles and repadmin checks.

Active Directory has no single master copy. Every writable domain controller accepts changes, and the changes spread to the others by multi-master replication. A password reset in Berlin shows up in Tokyo a short while later. Understanding how that spreading works explains most mysteries of the "I made the change but it is not there yet" kind, and tells you where to look when a domain controller falls behind.

This lesson covers replication mechanics, how sites and subnets shape it, the roles that are not multi-master (FSMO) and the checks you run. The tools (repadmin, dcdiag, Active Directory Sites and Services) are Windows-only; the examples are Python stand-ins for the logic.

Partitions and what replicates

The directory database (ntds.dit) is split into naming contexts (partitions) that replicate to different sets of servers:

Partition Content Replicates to
Domain Users, computers, groups of this domain All DCs of that domain
Configuration Sites, subnets, services, forest layout All DCs in the forest
Schema Class and attribute definitions All DCs in the forest
Application partitions (DomainDnsZones, ForestDnsZones) AD-integrated DNS DCs running DNS in the domain or forest
Global catalog (partial attribute set) A searchable subset of every domain's objects Global catalog servers

The SYSVOL folder (Group Policy templates and logon scripts) is not part of the database; it replicates with DFS Replication (DFSR), which is why a GPO can be partly replicated (see troubleshooting).

How a change travels: USNs and the up-to-dateness vector

Each DC keeps an update sequence number (USN) that increases with every write it makes or receives. A change is tagged with the originating DC's invocation ID and the USN. Each DC also remembers, for every partner, the highest USN it has already received from it (the high-watermark and up-to-dateness vector). When a replication partner asks "what is new?", the source sends only objects whose USN is above that mark. This is pull replication: destinations request changes, usually triggered by a short notification from the source (inside a site, change notification fires about 15 seconds after a change, then 3 seconds per additional partner).

Replication is at attribute level with multi-valued linked attributes handled value by value (so adding one member to a group does not resend the whole group).

Conflicts

If two admins change the same attribute on different DCs before replication, AD resolves it deterministically, with no human involved:

  1. The change with the higher version number wins.
  2. If equal, the one with the later timestamp wins.
  3. If still equal, the one from the DC with the larger invocation ID (GUID) wins.

Other conflicts: two objects created with the same name in the same container get one renamed with a CNF: suffix; an object created under a container that was deleted elsewhere is moved to LostAndFound.

Python Attribute conflict resolution (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A site is a set of well-connected IP subnets, usually a physical location with fast LAN links. It lets AD make decisions based on topology:

  • Clients find a nearby DC. A computer matches its IP address to a subnet object, which belongs to a site; the DC locator then prefers DCs in that site. A computer whose subnet is missing falls into the wrong site and authenticates across the WAN, a classic cause of slow logons.
  • Replication is compressed and scheduled between sites. Inside a site, replication is fast, uncompressed and notification-driven. Between sites it follows site links, with a cost, a schedule and an interval (default 180 minutes; as low as 15). Lower cost means preferred.

Site links can be bridged transitively, and a hub-and-spoke design with the hub as the main link works well for most companies.

The Knowledge Consistency Checker (KCC) runs on every DC every 15 minutes and builds the connection objects (the replication topology) automatically, a ring inside each site with at most three hops, and bridgehead servers between sites. You rarely edit it by hand.

Python Map IP addresses to sites

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The last line shows the problem: an undefined subnet puts the client in the default site, so make inventory of branch subnets part of your network change process. The nltest /dsgetsite command shows the site a machine believes it is in.

FSMO roles

A few operations cannot safely be multi-master, so five Flexible Single Master Operations roles each live on one DC at a time:

Role Scope Job
Schema Master Forest Only DC that may change the schema
Domain Naming Master Forest Adds or removes domains and application partitions
PDC Emulator Domain Authoritative time source, password-change urgent replication, lockout processing, preferred GPO editing target, legacy NT support
RID Master Domain Hands out blocks of 500 relative IDs to DCs for new SIDs
Infrastructure Master Domain Updates cross-domain object references (not on a global catalog unless every DC is one)

A new account's SID is the domain SID plus a RID from the DC's own pool. If the RID master is gone for long, DCs eventually run out and cannot create objects. Show the owners with netdom query fsmo. When a role holder fails temporarily, nothing happens except the role's specific job halting (the PDC emulator matters most for users). If the DC is permanently lost, seize the role on another DC with Move-ADDirectoryServerOperationMasterRole -OperationMasterRole 0,1,2,3,4 -Force or ntdsutil; if the old DC is still healthy, transfer it gracefully instead and never bring a DC whose role was seized back online without rebuilding it.

Place PDC and RID on the best-connected DC in the main site, and keep roles documented.

Checking replication health

TEXT
repadmin /replsummary
repadmin /showrepl
repadmin /syncall /AeD
repadmin /queue
dcdiag /v
dcdiag /test:replications
Get-ADReplicationFailure -Target dc1.example.com

/replsummary gives fail counts and largest delta per DC; deltas greater than a day need attention. Common causes of failure:

  • DNS: DCs cannot resolve each other's _msdcs CNAME records.
  • Firewall or routing blocking RPC, 389 or the dynamic range.
  • Time: Kerberos between DCs fails with more than 5 minutes of skew (clock skew).
  • Lingering objects: a DC offline longer than the tombstone lifetime (180 days by default) keeps objects that others deleted and must not be reconnected (backup and recovery).
  • USN rollback after restoring a virtual machine snapshot of a DC. Modern hypervisors expose a VM-GenerationID so Windows detects and protects against this; never copy or roll back a DC with snapshots on unsupported platforms.
Python Replication lag report (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which FSMO role is the authoritative time source for the domain?

    The PDC emulator of the forest root domain is the top time source, and other DCs sync from it down the hierarchy.
  2. 2. Two admins change the same attribute on different DCs at the same time. What decides the winner?

    AD applies a deterministic tie-break order so all DCs converge on the same value.
  3. 3. A computer in a branch office authenticates slowly across the WAN. What is the most likely cause?

    Without a subnet object the client is assigned to the default site and may use any DC.
  4. 4. What is the default tombstone lifetime and why does it matter?

    Deleted objects are kept as tombstones for this long so that every DC learns about the deletion.

Summary

  • AD replicates multi-master by USN-based pulls, resolves conflicts deterministically and replicates SYSVOL separately with DFSR.
  • Sites and subnets drive DC location and the schedule and cost of inter-site replication; the KCC builds the topology.
  • Five FSMO roles are single-master; transfer them gracefully and seize them only when the holder is permanently lost.
  • Use repadmin and dcdiag; most failures are DNS, firewall, time or a DC offline past the tombstone lifetime.

Next: Password Policies and Account Lockout