modifying records with dnscmd.exe

  • Thread starter William Stacey [MVP]
  • Start date
W

William Stacey [MVP]

use delete then add again. Or IIRC, just use RecordAdd again and the record
matching Name, Type, Class, will be updated with new RDATA and TTL.
 
D

Dave Peterson

Hi,

Does anyone know if it's possible and if so how to modify a host A record's
ip address using DNSCMD.exe ? I can see how to add and delete using the
/RecordAdd and /RecordDelete switches but no modify ?!

Thanks - Dave.
 
W

William Stacey [MVP]

Another option is use my NetDig 2.5rc1 which not has a GUI Update option.
Can do Add and Deletes with A records currently on nonsecure zones.
 
J

Jeff Westhead [MSFT]

dnscmd /RecordAdd will not generally perform a replace. (Although it does
for the SOA record type.)

Here's a quick example:

D:\>dnscmd /RecordAdd foo.com test A 1.1.1.1
Add A Record for test.foo.com at foo.com
Command completed successfully.

D:\>dnscmd /EnumRecords foo.com test
Returned records:
@ 3600 A 1.1.1.1
Command completed successfully.

D:\>dnscmd /RecordAdd foo.com test A 2.2.2.2
Add A Record for test.foo.com at foo.com
Command completed successfully.

D:\>dnscmd /EnumRecords foo.com test
Returned records:
@ 3600 A 1.1.1.1
3600 A 2.2.2.2
Command completed successfully.

D:\>dnscmd /RecordDelete foo.com test A
Are you sure you want to delete record? (y/n) y

Deleted A record(s) at foo.com
Command completed successfully.

D:\>dnscmd /RecordAdd foo.com test A 3.3.3.3
Add A Record for test.foo.com at foo.com
Command completed successfully.

D:\>dnscmd /EnumRecords foo.com test
Returned records:
@ 3600 A 3.3.3.3
Command completed successfully.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top