Link to home
Start Free TrialLog in
Avatar of SameerMirza
SameerMirzaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

DNSadd and DNS delete commands

Hi,
I have been trying to find the exact dnsadd and dnsdel commands - couldn't
Can any one please write the exact dns commands

Above part is most important. But if you can please answer below aswell
If I have a comma saperated text file with three parameters and row delimeter ';'
IP                    Host                record type
101.2.4.3        testserver       A

Can any please write a code - i think can be done in VB
to read the file and execute the dnscmd command?
or can it even be done just by BAT files
Basically if I drop a text file with may be particular extension at dir location.
How can we read the file and create dns records from it
not sure but badly in need of help

Big basket of thanks :)
   
ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Krzysztof Pytko
Have you tried with DNSCMD from Windows Support Tools? Using this tool it's easy and you can simply script all :)

Example:

Create
dnscmd DNSServerName /RecordAdd DNSZoneName HostName RecordType IPAddress

dnscmd mydns01 /RecordAdd mydomain.local testserver A 101.2.4.3

Delete
dnscmd DNSServerName /RecordDelete DNSZoneName HostName RecordType /f

dnscmd mydns01 /RecordDelete mydomain.local testserver A /f

Regards,
Krzysztof

@farhankazi: I'm sorry I didn't check your script code :( That I put the same code here

@SameerMirza: please skip my answer

Krzysztof
Avatar of SameerMirza

ASKER

thanks alot. I am very sorry for late reply :/