Scripting a change to an existing DNS record on a DNS server


As part of our DR solution using Wansync, we would like to create a script that changes the IP address of a host (A) record. Preferably VBScript - looked at the script repository on, couldnt see one that matches.

Many thanks
Who is Participating?
You can use the dnscmd command, from the Windows Support Tools (on the Windows 2003 CD) to add/remove DNS records.

I can go into syntax if you'd like, but I assume you're happy reading /? if you've been looking through vbs.
Obtain a copy of DNSCMD.EXE if it's not already present (it's part of the Support Tools) and use the following syntax -

dnscmd mydnserver.home.local /recorddelete mydnszone.local myhostname A /f
dnscmd mydnserver.home.local /recordadd  mydnszone.local myhostname A

... the /recorddelete isn't mandatory but note that the /recordadd will add a new record, not overwrite the original ... thus the delete statement ... your call though.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.