• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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