OK I'm failing badly here. I have a standalone (non-AD) server running DNS for around 50 zones, so any "simple" operation like modifying MX or SOA records isn't simple.

I know of dnscmd however it doesn't seem to have an option to let you specify "all zones" when adding/deleting records?

There does seem to be a (relatively) undocumented "..AllZones" feature, but this only seems to work with certain switches from what I can tell.

So let's say I want to simply add a new MX record to all domains, I don't seem able to do so unless I specifically write a batch file containing all the individual zone names.

Any ideas would be much appreciated, thanks.

link|improve this question

70% accept rate
feedback

2 Answers

up vote 1 down vote accepted

If you are ok using a batch file to do the work, you can use the FOR command to loop through all the files in the folder (or a subset of files depending on the parameters you use) to do the work.

FOR /F %%a (`dir /b c:\windows\system32\dns\ *.dns`) DO YourCommandGoesHere

I didn't test the command so the syntax may not be quite right.

link|improve this answer
feedback

thx. it helped me creating this commandline:

   FOR /F  "delims=. tokens=1,2" %%a IN ('dir /b c:\windows\system32\dns\*.db') DO (dnsmcd parameters)
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.