Configuring DNS Backup and Recovery in Windows Server 2012 R2

DNS is a core piece of AD DS infrastructure. AD DS relies heavily on DNS name resolution. When DNS Server disaster occurs, we need to restore DNS zone to a previous state as soon as possible. For this scenario, we have two options to perform this operation. First one is AD DS authoritative restore, an authoritative restore of Active Directory would take time consuming, complex and also requires the use of backups and restart of DCs. The second option is to use DNSCMD.exe command line tool to back up your zones to a text file, which is available for Windows Server 2003 (Support Tools) or natively in Windows Server 2008, Windows Server 2008 R2, Windows Server 2012 and Windows Server 2012 R2. DNSCMD restore takes few minutes to restore a zone. It applies to both forward and reverse zones, either text-based or Active Directory-Integrated.

Here, we create scenario like this:

  • First, we backup DNS zones using DNSCMD command line tool.
  • Second ,we delete msserverpro.com DNS zones from server for creating the disaster.
  • Finally, we restore msserverpro.com zone from a file created with DNSCMD command.

Take a backup of msservepro.com zone to a text file using DNSCMD command line tool:

1. Logon to Domain Controller, Open Windows PowerShell and type the following commands to backup DNS zones.

Open Powershell

 

 

 

 

dnscmd KTM-DC01-2K12 /ZoneExport  msserverpro.com backup\msserverpro.com.dns.bkp

dnscmd KTM-DC01-2K12 /ZoneExport  _msdcs.msserverpro.com backup\_msdcs.msserverpro.com.dns.bkp

where KTM-DC01-2K12 is dnsserver name. The backup copy (text file) of the DNS Zone will be saved to
C:\Windows\System32\dns\backup folder

dnscmd Command

2. Open explorer and navigate to the C:\Windows\System32\dns\backup folder to verify its contents.

Verify backup contents

 

Deleting DNS zones from our server for disaster:

1. Open DNS Manager Console.

2. Expand the KTM-DC01-2K12 node, then expand Forward Lookup Zones, select the msserverpro.com zone, right Click and Click Delete.

delete zone


3
. On the DNS dialog box, Click Yes twice to remove the zone from both Active Directory and the DNS Server.

delete zone Yes

Waring to remove the zone

 

Use DNSCMD command line tool to restore the domain DNS zone:

1. Open DNS Manager Console.

2. Expand the Server, KTM-DC01-2K12, then right click Forward Lookup Zone and Click New Zone..

2


3
. On the New Zone Wizard, Click Next.

3


4
. On the Zone Type Wizard, select Primary zone  and Uncheck the Store the zone in Active Directory (available only if DNS server is a writeable domain controller)

4


5. 
On the Zone Name Wizard, type the name of the zone being restored, msserverpro.com and click Next.

5


6. 
On the Zone File Wizard, select the option Use this existing file and Click Next.

6

Make sure the current backup of the msservepro.com is present in the following path,C:\Windows\System32\dns\backup .

6i

Copy the msserverpro.com.dns.bkp file to the parent folder (C:\Windows\System32\dns). Rename the file from msserverpro.com.dns.bkp to msserverpro.com (remove the .bkp extension). Click Yes.

6ii

6iii

6iv

6v

7.  Now go back to the Zone File Wizard, and click Next.

7


8. 
On the Dynamic Update wizard page, select Allow both nonsecure and secure dynamic updates and Click Next.

8


9. 
On the Completing the New Zone Wizard page, Click Finish.

9


10. 
Make sure the msserverpro.com is created. Then right Click the msservepro.com zone and select Properties.

 

10

11. On the msserverpro.com Properties dialog page, Click the Change.. button at Type: Primary field.

11

12. On the Change Zone Type page, make sure Primary zone is selected and select the option Store the zone in Active Directory (available only if DNS server is a domain controller) and click OK.

12


13. 
On the DNS dialog box, Click Yes to accept the change.

13


14. 
On the msserverpro.com zone Properties page, select Secure only at Dynamic updates field.

14


15
Finally, we should have our DNS Zone up and running..

Post a Comment

0 Comments