• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

How to issue CLI DNS command with wildcard

Chris1

Regular Pleskian
Hello,

I want to run a script that will loop through all of the domains on a particular server and remove all MX records with mail.*.

I am testing on a single test domain at the moment but I'm not sure how to do the wildcard.

/usr/local/psa/bin/dns -d example.com -mx '' -mailexchanger mail.*

How can I do this?

Also, in addition to this, I'd like to understand this command a little better. The following example command is from: http://download1.parallels.com/Ples...e/plesk-unix-cli/index.htm?fileName=37771.htm

To add an MX resource record mail3.example.com specifying domain name mail.example.com as the mail exchanger for the record, and setting the mail exchanger's priority to the DNS zone on the domain example.com to 15:

# ./dns -a example.com -mx mail3 -mailexchanger mail.example.com -priority 15

What does the mail3.example.com got to do with it? Isn't it just adding a MX record mail.example.com?
 
Last edited:
Back
Top