What is the best way to setup Backup MX?

I have a Virtualmin server (Centos) and I want to setup a second one to act (preferably) as:

a) Normal primary server (LAMP) for domains hosted in there PLUS
b) Backup MX for domains primarily hosted in the existing server. This is only to collect emails when the primary is down/offline.

  1. Is this possible?
  2. Is there a guide to the backup MX configuration?
  3. Will the backup MX also collect spam? (spam includes emails refused from the primary server)

Not sure where to start…
Any help is much appreciated.


To have backup MX you should use 3rd party DNS otherwise no point to have additional MX records. Usually when your email server doesnt work is when the server is down and so it will be your DNS if is hosted with the same server.

For the additional MX its should be easy, just add them in order of priority, e.g. your main MX record from Vmin will have priority 5 (i think this is default) and the rest can be 10, 20, 30… and so on. Dont forget to modify your SPF and DKIM records to reflect the changes.

Hi there and thank you for the response.
DNS is hosted elsewhere so no problems with that (which is common sense anyway! :slight_smile:
As far as the answer about priority etc I know all this. The question (rephrased) is how to setup a virtualmin server that will act as backup MX only (for when the primary is unreachable) and push the emails back to the primary, when the primary is reachable again.

Just to clarify - You want Vmin server to act as backup email server or you want Vmin server to have backup email server?

Either way it should be pretty simple, in both cases you just need to add mail server from the backup server as MX record. For Vmin that should be mail.domain.tld and if you have some other mail server (non-Vmin) then depends on the control panel and/or server settings.

The part about “push the emails” i’m not sure how could be done. Maybe there is some solution but i’m not aware of that.

In earlier days you had to have Virtualmin Pro on the primary server to get this working according to the documentation.
Maybe one of the devs can say if this is still a requirement?