When defining multiple MX Mail Exchanger resource records to load balance your inbound email, you have two options. The first option involves defining multiple MX Mail Exchanger records with the same preference. The second option is to define a single MX Mail Exchanger record and have multiple A records defined for that MX record. Both options allow you to have three different primary email servers accepting your inbound email. We finish by showing an example of configuring your MX Mail Exchanger record in a simple primary/secondary failover setup.

Option One

Define multiple MX records with the same preference.


MX 10 mail1.example.com
MX 10 mail2.example.com
MX 10 mail3.example.com

Make sure each mail server has its own A resource record defined.


mail1.example.com	A	192.168.15.1
mail2.example.com	A	192.168.15.2
mail3.example.com	A	192.168.15.3

Option Two

Define a single MX record.

MX 10 mail.example.com

Have that single host name defined with multiple A records in a simple round robin fashion.

mail.example.com	A	192.168.15.1
			A	192.168.15.2
			A	192.168.15.3

Dyn’s platform has the ability to monitor SMTP servers with our Load Balancing and monitoring service. If you select ‘(A) Failover and Load Balancing’ from the ‘Add Service/Record’ section when defining these A resource records, you can enable the SMTP probes (monitoring agents) for these IP addresses. The monitoring agents (probes) will monitor these IP addresses from three global locations, and if they determine that an IP address is unreachable based on the SMTP test, it will remove that IP address from the pool of available IP addresses. Please see the article titled Managed DNS Advanced Feature: Active Failover for more information.

Primary/Secondary configuration:

Instead of a load balance configuration, you can set up multiple mail servers into a primary/secondary configuration, allowing all email to be directed to the primary mail server unless it becomes unavailable.

This configuration involves having multiple MX records with different preference values.

MX 10 mail1.example.com
MX 20 backupmail.example.com

Next, make sure each mail server has its own A resource record defined.

mail1.example.com	A	192.168.15.1
backupmail.example.com	A	192.168.15.2

In this type of configuration the correct course of action is for in-bound email to be delivered to mail1.example.com. In the case where two MX records exist with different preference values defined, preference 10 will take precedence over the MX record with a preference of 20. Only backupmail.example.com would receive email if mail1.example.com was not responding.

Warning:

Spammers will sometimes target the higher preferred MX record trying to bypass your primary mail server’s spam and anti-virus software; sometimes an email will arrive at your secondary backup mail server.