Solved

Backup/Restore DNS

Posted on 2014-02-12
9
521 Views
Last Modified: 2014-02-14
Hi,

I'm looking for an easy way to be able to export/restore our DNS.  The DNS server is a Domain Controller so Active Directory is on there as well.  In case we have an incident where DNS zones/entries have been deleted, we would like an easy way to be able to restore them if needed.

Please let me know step by step on how to perform these tasks whether it be through a script or third party app.

Thanks
0
Comment
Question by:Lumious
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39854593
0
 

Author Comment

by:Lumious
ID: 39855293
Hi,

I see that you have replied on my other post about DHCP.  But this post is about DNS Backups/Restores, not specifically DHCP.

Please let me know when you get a chance.

Thanks
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39855941
I apologize for conflating the two posts!

As we're talking about Active Directory Integrated DNS, all the DNS information is backed up when you backup the System State of the Domain Controller.  Ideally, you should have multiple DCs, each running DNS, so the loss of a single DC doesn't impact Active Directory or your internal DNS.

You would really have to mess DNS up to justify doing a restore from backup.  But if you found yourself in that position, I would recommend doing an Authoritative Restore of Active Directory as well, since AD and DNS are so tightly integrated.
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

Author Comment

by:Lumious
ID: 39856668
Hi,

One of our issues that we ran across recently was that on our main Domain Controller which has AD, DNS, and DHCP, some entries/zones, were removed, along with DHCP zones.  Once we noticed what happened, it had replicated out to the other DC's in the environment.  So we had to actually restore a DC from a previous backup to get the entries/zones of the DNS, grab them, and then restore them on the main DC so that it would push it out to the rest of the DC's in the environment.  So we basically had a major DNS issues all throughout our environment.

So if this ever happens again, that's why I was wondering what the best and easy way would be to be able to backup the DNS entries/zones either manually/automatically, so that we would be able to restore everything in a heartbeat if we ever needed to.

Please let me know when you get a chance.

Thanks
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 39856726
AD and DNS should be consistent (it should be exactly the same) across all the Domain Controllers in a domain.  If you lost AD and/or DNS data when you lost a single Domain Controller, something was wrong.

DHCP is different of course because each server has a different piece of the total zone (the total set of IP addresses).  Nevertheless, if you have adequate IP addresses, any clients from the missing server should simply have gotten new addresses from one of the remaining DHCP servers and kept right on trucking.

Now, if someone changed DNS (removed AD records or some such) it's true those changes would propagate and cause you problems.  In that case, restoring any/all of the Domain Controllers from backup should have addressed the issue.  As far as Active Directory Integerated DNS is concerned, there is no "main server" - it's all one big namespace.  To your point, if AD is okay but AD DNS is bad, you're going to have problems that persist after doing a restore.

"If it ever happens again" here's how you can backup and restore AD DNS.  But I wouldn't rely on that.  Do System State backups, maintain several Domain Controllers, and keep the riff-raff off your server.

Hope that helps, and wasn't too preachy.
0
 

Author Comment

by:Lumious
ID: 39857630
Hi,

After reviewing you post and the link provided I believe I have a full understanding of this now.

I actually tried out the command script to backup one of the DNS zones and was successful.  

Now if I wanted to run this command script on an automated schedule, what would your suggestion be?  To run this manually I ran it through PowerShell and it exported/backed up the DNS zone to the location.

Ex:

dnscmd SERVERNAME /ZoneExport domain.com backup\domain.com.dns.bkp

Also when I tried to run this script a second time, it fails out and indicates in the PowerShell screen that "Error_Already_Exists".  So maybe there could be something added to this where it puts the "date/time" on the end of the file it exports so that it could be run again and again.

Please let me know when you think?  If I have to start up another question I can.

Thanks
0
 
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 500 total points
ID: 39857998
0
 

Author Comment

by:Lumious
ID: 39859169
Hi,

I've been trying to get the following command to run through task scheduler but have been unsuccessful.

dnscmd SERVERNAME /ZoneExport  DOMAIN.COM backup\DOMAIN.COM.dns.bkp

The manual way I do it, is to open powershell as Admin, and copy and paste the command into the window, and it runs successfully.

I need to know how to make this run through the task scheduler.  I'm not a scripter so I don't know what commands I have to put in the .ps1 file (powershell) in order for this to execute correctly.

Please let me know when you get a chance.

Thanks
0
 
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 500 total points
ID: 39859325
Per the first two links in my previous post, create a file (let's call it BackupDNS.ps1) with your command in it.  So we have a .ps1 file and in it is the line...
     dnscmd SERVERNAME /ZoneExport  DOMAIN.COM backup\DOMAIN.COM.dns.bkp

Then, in TaskScheduler, create a new task that runs powershell with the -File switch pointing to BackupDNS.ps1.  You may need the full path to PowerShell, and you may need the full path to your .ps1 file.  So the scheduled task will run...
     powershell -File BackupDNS.ps1
...and that should do it.

Depending on your operation system, the version of PowerShell you use will be at
     %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
or
     %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe

Hope that helps!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question