Solved

Export MIcrosoft DNS structure and records

Posted on 2009-05-14
8
1,098 Views
Last Modified: 2012-05-07
Hi,
I've got about 100 DNS zones (mostly AD intergrated) and I need to export a list of the entie structure, including sub doimains and all hosts.
I've looked at various options with DNSCMD, but nothing seems to export everything.
Any thoughts?
Thanks.
0
Comment
Question by:undercover69
[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
  • 4
  • 3
8 Comments
 
LVL 7

Expert Comment

by:dineesh
ID: 24385715
hi,

You will need to backup

From Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones

If you dns records are stored on filesystem then this folder too..
From File system:
C:\WINDOWS\system32\dns

regards
Dinesh
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24385997

DNS Records aren't stored there if it's AD Integrated.

But DNSCMD does have a ZoneExport option that can be used.

Are you looking to get the zone files? Or a list of records in a non-DNS format?

Chris
0
 

Author Comment

by:undercover69
ID: 24386048
I don't really mind what format it is in, it's only for audit purposes to get an idea of the overall DNS structure, it's not going to be used to as a backup, or an import anywhere else.
It is predominantly the AD integrated ones I am after, I can grab the zone files for the other ones.
Thanks!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 71

Expert Comment

by:Chris Dent
ID: 24386141

Then a tiny bit of VbScript will get them all for you :)

If it needs to run remotely you need to add the server name into each DNSCMD call. However, it'll create the export on the server in %SystemRoot%\System32\DNS whatever you do.

HTH

Chris
Set objShell = CreateObject("WScript.Shell")
arrOutput = Split(objShell.Exec("dnscmd /EnumZones /Primary /Ds").StdOut.ReadAll, vbCrlf)
 
For Each strLine in arrOutput
  If Instr(strLine, "Primary") > 0 Then
    strZoneName = Split(strLine, " ")(1)
    WScript.Echo objShell.Exec("dnscmd /ZoneExport " & strZoneName & " Export-" & strZoneName & ".dns").StdOut.ReadAll
  End If
Next

Open in new window

0
 

Author Comment

by:undercover69
ID: 24410534
Hi chris,

Sorry for the delay in replying, and thanks for the code.

it works fine, execpt that it doesn't seem to export the sub-domians?

Thanks again for your time.
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 250 total points
ID: 24410694

Really? Sub-domains as separate zones? Delegated or local?

If you run this on its own does it return the zone name you're after?

dnscmd /EnumZones /Primary /Ds

Chris
0
 

Author Comment

by:undercover69
ID: 24410891
ah, please ignore me, I was doing something daft that I am not prepared to admit to here:-)

Thanks Chris, perfect mate, points coming your way.
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24410953

No worries :)

Chris
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I've written instructions for one router type, but this principle may be useful for others of the same brand and even other brands of router. Problem: I had an issue especially with mobile devices that refused to use DNS information supplied via…
Resolve DNS query failed errors for Exchange
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

752 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