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 domain.com --remove-record “mail.domain.com MX”

or

virtualmin modify-dns --domain domain.com --remove-record “5 mail.domain.com MX”

and how i can add same DNS?

thanks

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 “mail.domain.com MX” in your zone, but “domain.com MX” pointing to “mail”, and then a record “mail A”.

Try this:

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

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

Replace “5.6.7.8” 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 domain.com --remove-record "domain.com. MX" virtualmin modify-dns --domain domain.com --add-record "domain.com. MX where-the-mx.shall-point-to.com."

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

Thanks, man. Sorry for delay.

Hi,

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

is this correct?

virtualmin modify-dns --all-domains --remove-record "mx.domain.com MX"