|
Question : How to add a DNS entry through command line in Windows....
|
|
Hi ,
I would like to add DNS entry for the windows client machine, is there any command line utility where i can add the entry... If any of you guys plz let me know.
Thanks inadvance, MC.
|
Answer : How to add a DNS entry through command line in Windows....
|
|
PeteLong, From Batch FIle
From http://cwashington.netreach.net/dep...iptType=command
Script:
The BAT file creates a series of record into DNS. It uses as input the file LISTA.TXT. In this file you have to specify the name of the record and the value that it wil have.
IF you open the BAT file you'll see that you have to specify also after DNSCMD a server that contain the zone (SERVERNAME) the parameter /RecordADD, to add the record and the ZONE where you want to add the record.
You can also specify if the record you want to add is an HOST or an ALIAS. To do so you have to put beetween the RECORD_NAME; and the value XXX.XXX.XXX.XXX or alias the value:
A = HOST CNAME = ALIAS
so the result of the string inside the input.txt result:
RECORD_2_ADD;A;IP_ADDRESS
OR
RECORD_2_ADD;CNAME;ALIAS_WHERE_POINT
BATCH FILE: ********
for /f "tokens=1-3 delims=;" %%a in (input.txt) do ( dnscmd SERVERNAME /RecordAdd ZONE_WHERE_ADD_RECORD %%a %%b %%c >>insert.log)
|
|
|
|