• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

need to modify mx records in 50+ zones, is there a way to script this using DNSCMD?

Can someone provide a script that will allow me to modify the cost/weight of 50+ mx records and add 2 additonal mx records to each zone file?

many thanks!

S.
0
siber1
Asked:
siber1
  • 2
1 Solution
 
farzanjCommented:
If you could provide input and output sample.  Second, is it for Linux or Windows?
0
 
siber1Author Commented:
hi farzanj,
i would like to reference an input text file and list all the zones in there.

for example:  our primary zone: xyz.com
has to mx records:

mxa.xyz.com  cost 10
mxb.xyz.com  cost 10

i would like to use the DNSCMD script to first change these costs to 20
and add (2) new mx records: [we are addding 2 new MTA gateways]

newmxa.xyz.com cost 10
newmxb.xyz.com cost 10

many thx.

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

Open in new window

0
 
siber1Author Commented:
thx anyway
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now