Solved

need a powershell script to add in IP addresses into the DNS zone transfer list

Posted on 2014-01-05
5
1,112 Views
Last Modified: 2014-01-06
can someone provide a script that we can run to add (2) IP addresses into the DNS server "zone transfer authorized list"

we have 300+ zones to add these IP's on.

many thanks!

S.
0
Comment
Question by:siber1
  • 4
5 Comments
 
LVL 12

Accepted Solution

by:
Chris earned 500 total points
Comment Utility
You can easily do this using dnscmd. The following command should achieve what you're after:

dnscmd SourceServerName /ZoneResetSecondaries ZoneName /SecureList DestinationServerIPs

Where:
SourceServerName is the name of the server you're setting the zone transfer settings on.
ZoneName is the name of the zone you're setting the zone transfer settings for.
DestinationServerIPs is a space delimited list of IP address for servers which are allowed to transfer the zone from the source server.
0
 

Author Comment

by:siber1
Comment Utility
yes, but I need to do this on 300+ zonenames, which is why I was asking for a script that can accomplish this in bulk.

thx
0
 

Author Comment

by:siber1
Comment Utility
I think this may be a way to automate it.
import-csv records.csv | foreach  {dnscmd SourceServerName /ZoneResetSecondaries /ZoneName /SecureList 10.1.1.1 10.2.2.2 10.3.3.3 10.4.4.4}

Open in new window

0
 

Author Comment

by:siber1
Comment Utility
when I run the script directly on the master nameserver [one zonename for testing] I get command failed RPC_s_SERVER_UNAVAILABLE 1722 0X6BA
0
 

Author Comment

by:siber1
Comment Utility
figured it out. need to set the variable in the script to $_.ZoneName

works fine now. thx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This article will help you understand what HashTables are and how to use them in PowerShell.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now