How i can use modify-dns command line??

4 posts / 0 new
Last post
#1 Tue, 10/16/2012 - 00:32
zoodyc

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

Tue, 10/16/2012 - 08:12
Locutus

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:

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

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.

Tue, 10/30/2012 - 08:00
zoodyc

Thanks, man. Sorry for delay.

Wed, 07/23/2014 - 21:34
RyanJohnson

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"
Topic locked