Thursday, 3 June 2010

Adding DNS entries via command line

Use this little time-saver when you have a large number of DNS entries to add. You will need admin access to the DNS server.

It uses the dnscmd.exe command line tool so you can easily put it into a batch file and add many entries at once.

For example:
dnscmd servername /recordadd mydomain.com host /createptr A 192.168.0.1
The command above will add a record of 'host.mydomain.com' with an address of 192.168.0.1 into the server specified in 'servername' and it will also create the corresponding PTR (reverse-dns) entry.

dnscmd.exe can also be used for all other Windows DNS-related commands.

No comments:

Post a Comment