Adding few DNS records from GUI is a breeze, but when you have more than one some automation will help.
Windows provides command line tools to help you with that.
But the trick is that you have to get your hands “dirty” and type some commands in bat file.
In this case I’m using dnscmd tool (from Windows Support Tools).
If you are unsure how to install it check Install Windows Support Tools tutorial from Microsoft
Here is dns.bat:
echo “We are reading records from records.txt”
for /F “tokens=1,2,3 delims=,” %%G in (records.txt) do dnscmd %dnshost% /RecordAdd %domain% %%G %%H %%I
It reads records from records.txt formatted in following way:
First record is hostname (without domain) followed by record type (A, PTR…) and last ip addres
NOTE: there is comma separating all values
How to use it:
1. Put your records in records.txt
2. type dns.bat
3. That it is… (Probably good time to validate 🙂 )