Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

script to change zone transfer settings

1,967 views
Skip to first unread message

mmccaws2

unread,
Apr 28, 2010, 12:17:59 PM4/28/10
to
Hi Guys

I have a DNS secondary provider that uses an zone transfer server to
upload that is not listed in the name server list. I have over 50
zones to make the change on and would rather make the changes using a
script. The zone transfer information is stored in registry under
hklm>SOFTWARE>Microsoft>Windows NT>CurrentVersion>DNS Server>Zones

under each zone file name.

Of course this means that all the name servers ip addresses need to be
listed. Could you point me to a script examples that I may use.

Thanks ahead

mmccaws2

unread,
Apr 28, 2010, 1:27:07 PM4/28/10
to

i did find this

dnscmd /ZoneResetSecondaries <zonename> /SecureList <ipaddress>
<ipaddress> ...

can I use a looping batch file to enter these?

Chris Dent

unread,
Apr 28, 2010, 2:12:24 PM4/28/10
to

Yes, you can indeed.

Perhaps the simplest way to hack a batch file together is with Excel.

Run this to get a list of zones:

dnscmd /EnumZones /Primary

Paste the zone list into a column in Excel.

In the column to the left, add "dnscmd /ZoneResetSecondaries", and in
the columnn to the right add "/SecureList", then the new IP addresses in
the next column, and finally the Notify options if you wish to set those
in the columns after that.

A bit of copy down for those commands to fill up then sheet then Copy
and paste the lot from Excel back into Notepad, save as .bat and you're
all set.

If you prefer VbScript it is entirely possible to deal with this using
the WMI interface.

And if you use PowerShell I have a DNS module which wraps up the
majority of the WMI interface and should allow a great deal of
flexibility. Something like...

Get-DnsZone | ?{ $_.ZoneType -eq "Primary" } | %{
Set-DnsZoneTransfer -Identity $_.Identity `
-ZoneTransfer List -SecondaryServers 1.2.3.4, 2.3.4.5 }

Whatever you like best and find easiest :)

HTH

Chris

mmccaws2

unread,
Apr 28, 2010, 4:09:17 PM4/28/10
to

Thanks

I'll start with the excel. Then later I'll try the PS.

0 new messages