Add / remove DNS entries
Top  Previous  Next


[Settings_Begin]
BatchSettings.Delimiter=;
BatchSettings.MarkerCol=5
//BatchSettings.Debug=Yes
SET Zone=d2.acme.com
[Settings_End]

[Machines_Begin]
\\EDU8
[Machines_End]

[Batch_Begin]
Data.Loop   
 DOS dnscmd %servername% /RecordAdd %Zone% "%col1%" A %col2%   
Data.Endloop   
[Batch_End]

[Undo_Batch_Begin]
Data.Loop   
 DOS dnscmd %servername% /RecordDelete %Zone% "%col1%" A /f   
Data.Endloop   
[Undo_Batch_End]

[Data_Begin]
testhost1;192.168.0.10
testhost2;192.168.0.20
testhost3;192.168.0.30
[Data_End]

What the script does


Add / remove three entries (testhost1 / 192.168.0.10 etc.) to / from the forward lookup zone d2.acme.com on the DNS server \\EDU8.

Required


dnscmd.exe

What to modify in the example

·[Settings]: Zone = DNS zone to modify  
·[Machines]: netbios name(s) of the DNS server(s)  
·[Batch]: dnscmd parameters. (Type dnscmd at the command prompt to learn more about dnscmd.)  
·[Data]: entries to add / remove