• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 814
  • Last Modified:

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 Microsoft.com, couldnt see one that matches.

Many thanks
2 Solutions
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.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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