Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1451
  • Last Modified:

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

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
siber1
Asked:
siber1
  • 4
1 Solution
 
ChrisCommented:
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
 
siber1Author Commented:
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
 
siber1Author Commented:
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
 
siber1Author Commented:
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
 
siber1Author Commented:
figured it out. need to set the variable in the script to $_.ZoneName

works fine now. thx
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now