Environment: Windows 2003 server, AD integrated DNS
I'm having a devil of a time tyring to do a delete/replace all A and www records in 1000+ DNS records for our websites (the IIS server has moved to another IP address (220.127.116.11)) and I'm also trying to set up a new DNS server. I am on the new DNS server and all DNS zones have been set up, but they have the old A and www records pointing to the IP address of the old IIS server.
I have written two batch files and I am executing one against the other.
One .bat program has all the website names and I am doing a
for %%1 in (
The second .bat file against which the first program is executing has the following dsncmd commands:
dnscmd /recorddelete %1 @ A www /f
dnscmd /recorddelete %1 @ A 18.104.22.168 /f
dnscmd /recordadd %1 @ A www 22.214.171.124 /f
dnscmd /recordadd %1 @ A 126.96.36.199 /f
From the commands, you can see I am trying to delete the A and www records in each DNS zone and replace them with new a and www records.
When I run the program batch file against this second one, it keeps giving me invalid syntax or missing syntax errors . The program goes through all the websites (and gives all the errors), so I don't see a problem with the first .bat file that contains the for/do program and the domains. The problem appears to be in my syntax in the second .bat file that contains the dnscmd lines. What am I doing wrong? I have tried all kinds of combinations and nothing works.