adding a record to many zones

N

NoBoDy

Hello all

I am trying to add a dns record to certain zones running on a dns server.

By using 'dnscmd . /recordadd local.dom @ mx 10 smtp' I can add a mx record
of smtp to the local.dom zone.

But how can I expand this command (or use other commands) to add 1 dns
record to hundreds of zones, maybe a list of zones contained in a file or
just to zones containing certain characters.

Regards
 
A

Ace Fekay [MVP]

In
NoBoDy said:
Hello all

I am trying to add a dns record to certain zones running on a dns
server.
By using 'dnscmd . /recordadd local.dom @ mx 10 smtp' I can add a mx
record of smtp to the local.dom zone.

But how can I expand this command (or use other commands) to add 1 dns
record to hundreds of zones, maybe a list of zones contained in a
file or just to zones containing certain characters.

Regards

You'll need to be creative with a little scripting (bat file or otherwise).

Some possible su ggestions, unless someone here in the groups specifically
writes a snippet of code for you:

http://cwashington.netreach.net/depo/view.asp?Index=967
http://www.informit.com/articles/article.asp?p=19413&seqNum=3&rl=1
http://jdhitsolutions.blogspot.com/

I like CWashington. His site was down for awhile, but it's back up again.
Lot;s of goodies there. You can also search Google for more. Here is what I
found:
http://www.google.com/search?hl=en&lr=&rls=GGLR,GGLR:2006-06,GGLR:en&q=dnscmd+scripting

--
Ace
Innovative IT Concepts, Inc (IITCI)
Willow Grove, PA

This posting is provided "AS-IS" with no warranties or guarantees and
confers no rights.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
Microsoft MVP - Directory Services
Microsoft Certified Trainer

Having difficulty reading or finding responses to your post?
Instead of the website you're using, I suggest to use OEx (Outlook Express
or any other newsreader), and configure a news account, pointing to
news.microsoft.com. This is a direct link to the Microsoft Public
Newsgroups. It is FREE and requires NO ISP's Usenet account. OEx allows you
to easily find, track threads, cross-post, sort by date, poster's name,
watched threads or subject.
It's easy:

How to Configure OEx for Internet News
http://support.microsoft.com/?id=171164

Infinite Diversities in Infinite Combinations
Assimilation Imminent. Resistance is Futile
"Very funny Scotty. Now, beam down my clothes."

The only constant in life is change...
 
H

Herb Martin

NoBoDy said:
Hello all

I am trying to add a dns record to certain zones running on a dns server.

By using 'dnscmd . /recordadd local.dom @ mx 10 smtp' I can add a mx
record of smtp to the local.dom zone.

But how can I expand this command (or use other commands) to add 1 dns
record to hundreds of zones, maybe a list of zones contained in a file or
just to zones containing certain characters.


Batch: For /f ... in (filename) ... do ...

Get zone list into a file (using DNSCMD if you wish): zones.txt
(dnscmd /enumzones then clean top, bottom, and remove unneeded
zones, e.g., reverse etc.)

Then:

for /f %a in (zones.txt) do dnscmd . /recordadd %a @ mx 10 smtp

(Assuming your original command worked -- I didn't test this but
just typed it from memory and your example.)

Technically it could be done in one command but you can check
for /help for that if you wish -- and it is ugly because the result
of DNSCmd /enumzones has to be either parsed, or cleaned up
in a text editor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top