How To Bulk Upload DNS Records

The other day I had to add new A records for just over 250 hosts, not something I wanted to do manually! Hunting around I found some good pointers but nothing concrete, so I thought I’d put my process on here.

First, it’s worth making sure you understand and test (if needed) the dnscmd.exe tool. For example, if you want to add a standard A record to you DNS you would use the following:

dnscmd DNSServerName /RecordAdd DNSZoneName HostName RecordType IPAddress

For clarity, this could be:

dnscmd DNSServer1 /RecordAdd host1 A

Once you’ve got that down, we can then manipulate the command to pull in a list of the updates you want to do:

I put the list of IP’s and Hostnames seperated by a space into a .txt file like so:


I then used some basic batch style scripting to pull those into a command:

for /f "tokens=1-2" %i in (C:\dnsimport.txt) do dnscmd DNSServer1 /RecordAdd %i A %j


You can import pretty much most types of record this way.


Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: