These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for How i can use modify-dns command line?? on the new forum.
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:
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:
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"