Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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