Add Multiple IP Addresses to DNS

A new project was put in place to upgrade our VOIP system.  This involved contracting with a new managed service provider.  The provider built 50 new VMware hosts in two redundant locations resulting in 50 new IP addresses to be added to DNS.

Adding multiple IP addresses to DNS can take a long time if done one by one.  PowerShell to the rescue!  Below are the steps I took to quickly add the new servers to DNS.

First, I created a .csv file with the server names, IP addresses and the zone to which they would be added.

Example .csv file entries below:


Then I ran the PowerShell code below which added the server IP Addresses to DNS along with their PTR records.

Import-CSV -Path D:\Scripts\DNSimport.csv | ForEach-Object {dnscmd DNSSERVER01 /RecordAdd $_.Zone $_.HostName /CreatePTR A $_.IPaddress}

Note:  You will need to have the DNS management tools installed for this command.