Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Export MIcrosoft DNS structure and records

Posted on 2009-05-14
8
Medium Priority
?
1,113 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
I wrote this article to explain some important DNS concepts that should be known to avoid some typical configuration errors I often see in forums. I assume that what is described here is the typical behavior of Microsoft DNS client. I don't know …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 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