Skip to content

Identity and DNS Recovery

github-actions[bot] edited this page Nov 29, 2026 · 1 revision

Last reviewed: 2026-11-29 (summarized from Microsoft Learn pages dated as shown; not exercised against a real forest or tenant)

Caution

Authorized use only. Forest recovery seizes operations master roles, resets the krbtgt and administrator passwords and deletes domain controller metadata. These steps are disruptive and partly irreversible. Perform them only under an incident record, with authority from the directory owner, following the current Microsoft procedure rather than this summary. See LEGAL.md.

Prerequisites: Recovery index ยท Recovery dependency mapping ยท Cloud identity incident response

๐ŸŽฏ Purpose

Summarize, with sources, how the directory and the name resolution it hosts are brought back after a destructive event: on-premises Active Directory through Microsoft's forest recovery procedure, and Microsoft Entra ID through Entra Backup and Recovery.

โš™๏ธ Function

Gives the decision points and step order from Microsoft's documentation, records what each mechanism cannot recover, and links to this repository's cloud identity guides for session revocation and break-glass access instead of repeating them.

๐Ÿ† Goal

A trusted directory, restored in isolation, with attacker-known secrets (krbtgt, administrator, computer and gMSA passwords) replaced before it serves production again.

๐Ÿ“‹ When To Use

  • Domain controllers were encrypted, wiped or are suspected of compromise.
  • Planning which DC backups to keep and how to test them.
  • A cloud tenant's users, groups, applications or Conditional Access policies were changed or deleted in bulk.

๐Ÿ›๏ธ Active Directory Forest Recovery

Source: AD Forest Recovery Guide. The step pages cited here carry ms.date 2023-07-10 on Microsoft Learn ("Determine how to recover" was updated 2025-09-11 and "Perform initial recovery" 2026-02-16).

Before An Incident

From Determine how to recover:

  • Restoring from backup loses all objects and changes made after the last trusted backup.
  • "Back up at least two writeable DCs for each domain." A backup of a read-only DC cannot be used to restore a writeable DC.
  • Choose a backup old enough to predate the problem: Microsoft suggests one "taken a few days before the occurrence of the failure". That is a trade between losing recent changes and restoring the attacker's.
  • A backup is only usable within its lifetime, which with the Recycle Bin enabled is the lesser of deletedObjectLifetime and tombstoneLifetime.
  • The Dsamain.exe database mounting tool exposes backups or snapshots as an LDAP server, and scheduled ntdsutil snapshot copies help identify when the failure occurred and which backup holds the last safe state.
  • You must know a Domain Admin password for each domain and the DSRM password; Microsoft suggests archiving the Administrator and DSRM password history for as long as the backups are valid.
  • Recover in isolation: the preferred scenario is to shut down all writeable DCs before the first restored DC returns to production. Read-only DCs can keep running and are rebuilt after the writeable DCs are recovered.
  • If the AD database of a writeable DC was compromised, Microsoft says a new KDS root key should be created after recovery and gMSAs re-created, depending on the scenario.

Initial Recovery Order

From Perform initial recovery. Start with a writeable DC in the forest root domain, then the other domains; "always recover a parent domain before recovering a child". On the first restored DC of each domain:

  1. Keep it off the production network (disconnect the cable or use an isolated virtual network).
  2. Perform a nonauthoritative restore of AD DS and an authoritative restore of SYSVOL, with an Active Directory-aware backup application. The authoritative SYSVOL restore is for the first restored DC only.
  3. Verify that the restored data is not affected by the failure; if it is, repeat with a different backup.
  4. Continue only after the data is verified and before the computer joins the production network.
  5. If an attack is suspected, reset passwords for all administrative accounts, and the krbtgt account, before more DCs are installed; replace gMSA passwords as well.
  6. If user accounts may be compromised, plan a password reset for all users.
  7. Seize the operations master (FSMO) roles.
  8. Clean up the metadata of every other writeable DC in the domain.
  9. Make sure DNS is running on the DC; in the forest root, point the DC at its own IP address as preferred DNS server. Delete NS records of removed DCs and check their SRV records are gone; nltest.exe /dsderegdns:server.domain.tld speeds up SRV removal.
  10. "Raise the value of the available RID pool by 100,000", so new objects cannot reuse security identifiers that still hold access rights from objects lost in the restore.
  11. Invalidate the current RID pool (already done if a system state restore was performed).
  12. Reset the DC's computer account password twice.
  13. "Reset the krbtgt password twice". Microsoft's reason: "Because the krbtgt password history is two passwords, reset passwords twice to remove the original (prefailure) password from password history." Trust passwords may also be reset after a breach.
  14. In a multi-domain forest, remove the global catalog role from the restored DC to avoid lingering objects.
  15. Re-create gMSAs if their key material may be exposed (see Microsoft's golden gMSA guidance linked from the step page).
  16. Configure the PDC emulator in the forest root to take time from an external source.

Then join the restored DCs to a common network that is isolated from the rest of the environment and validate forest health; after validation, Microsoft joins them to the production network and checks replication with repadmin /replsum, Repadmin /viewlist * and DCDiag /v. Add a global catalog in the forest root and watch for event ID 1119. Microsoft then recommends a new backup of each restored DC before redeploying the rest.

For krbtgt-specific detection and reset context already in this repository, see Active Directory tradecraft: krbtgt and the domain persistence checklist.

โ˜๏ธ Microsoft Entra Backup And Recovery

Source: Backup, difference report, and recovery model (ms.date 2026-10-19, updated 2026-11-17).

Topic What Microsoft documents
Frequency "Backups are created automatically once per day."
Objects Users (including agents' user accounts), groups, applications, service principals, Conditional Access policies, named location policies, the authentication method policy, the authorization policy and the organization object
Recovery model Added since the backup โ†’ soft-deleted; updated โ†’ set back to the backup value; soft-deleted โ†’ restored; restored โ†’ soft-deleted. "Backup and Recovery doesn't create new objects or hard-delete objects from your tenant."
Hard deletes "Hard-deleted objects can't be recovered." Hard Deletion Protection can block permanent deletion during the first seven days after a soft delete; soft-deleted users, Microsoft 365 Groups, cloud security groups, application registrations and service principals can also be restored through soft deletion within a 30-day retention window
Synced objects Objects synchronized from on-premises AD cannot be recovered here, because their source of authority is on-premises; recover them in AD. Their changes still appear in difference reports
Scope Workforce tenants only (not External ID or Azure AD B2C). Mailboxes, OneDrive, SharePoint and Azure resources are not covered
Throughput Only one job (difference report or recovery) runs at a time; recovering 500,000 changes "can take up to 30 hours", excluding data loading

How many daily backups are retained was not confirmed on a primary page during this review; check the current Microsoft documentation before relying on a retention window.

Warning

Restoring a directory object's attributes does not end an attacker's sessions or remove credentials they added. Revoke sessions and remove rogue credentials as described in token theft & session revocation, and use break-glass access as described in identity lifecycle & privileged access.

๐ŸŒ DNS

For AD-integrated DNS, DNS recovery is part of forest recovery (step 9 above): the forest root domain usually holds the DNS root for the forest's namespace and the records other DCs need for replication. NIST SP 800-209 RA-SS-R2 names "Active Directory and DNS" as dependent components to protect for full recovery. Recovery of DNS that is not AD-integrated (external authoritative zones, registrar settings, standalone resolvers) was not researched for this guide; record the zone backups, registrar accounts and their credentials in the dependency map.

See also

Related Files


โฌ…๏ธ Recovery index | Incident Response index | Master Index | ๐ŸŽฏ Role Navigation | Legal Notice


๐Ÿ“„ Source: IncidentResponse/Recovery/identity-and-dns-recovery.md | โœ๏ธ Suggest an edit | โฌ…๏ธ Back to Incident Response

Clone this wiki locally