undercover69
asked on
Export MIcrosoft DNS structure and records
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.
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.
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
ASKER
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!
It is predominantly the AD integrated ones I am after, I can grab the zone files for the other ones.
Thanks!
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
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Thanks Chris, perfect mate, points coming your way.
No worries :)
Chris
You will need to backup
From Registry
HKEY_LOCAL_MACHINE\SOFTWAR
If you dns records are stored on filesystem then this folder too..
From File system:
C:\WINDOWS\system32\dns
regards
Dinesh