modifying records with dnscmd.exe

  • Thread starter Thread starter William Stacey [MVP]
  • Start date 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.
 
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.
 
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.
 
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.
 
Back
Top