How i can use modify-dns command line??

i try many times, with many different commands

How i run one command like this:

virtualmin modify-dns --domain --remove-record “ MX”


virtualmin modify-dns --domain --remove-record “5 MX”

and how i can add same DNS?


What exactly are you trying to achieve? Modify the IP address where mail for your domain is delivered to?

You wouldn’t want to remove/re-add the MX record for that, but the A record that the MX points to.

There is no record “ MX” in your zone, but “ MX” pointing to “mail”, and then a record “mail A”.

Try this:

[code]root@lyra:~# virtualmin modify-dns --domain --remove-record “mail A”
Updating server
… done

root@lyra:~# virtualmin modify-dns --domain --add-record “mail A”
Updating server
… done[/code]

Replace “” with the desired IP address.

Pay attention though! If you have the feature “Mail for domain” enabled (and the existence of a “mail” DNS record hints at that), the “mail A” entry MUST point to your IP address! Otherwise you will get warnings and things will not work when local processes try to deliver mail. If you want mail delivered to an outside IP address, you have to turn off the “Mail for domain” feature.

If your aim indeed is to modify the MX record for your zone, and you have “Mail for domain” already disabled, you can do so like so:

virtualmin modify-dns --domain --remove-record " MX" virtualmin modify-dns --domain --add-record " MX"

Heed the “.” at the end of the domain names.

Thanks, man. Sorry for delay.


What the syntax for removing an MX record out of --all-domains?

is this correct?

virtualmin modify-dns --all-domains --remove-record " MX"