Create failover for DNS MX record and smtp

domain-name-systemfailover

Have a question, I have mail server behind two separate public IP addressees, ISP1 and ISP2 – with auto failover.
On my domain provider I have A record mail.domain.com pointing to ISP1 and then MX record with this record A.

Now I need to configure failover, I know that I can:
-configure new A record mail2.domain.com and point it to ISP2
-configure second MX entry for that A record with lower priority than first MX record.

But every of e-mail client (I have many of them) is configured to have imap and smtp server like mail.domain.com so my first A record.
How to achieve failover like this without reconfiguration every e-mail client when my gateway change to ISP2 and my e-mail server with be accessible on ISP2 IP?

I see that are services like dnsmakeesy.com – I wonder if paid solution is the only one?

thanks for your help.

Best Answer

You can approximate this with multiple A records for mail.example.com and use that for IMAP and POP. Clients will connect to either if both interfaces are working, and connect to the working interface if one is down. Clients will have a delay connecting when one side is down it they try the IP address of the interface is down. The delay will likely occur on half the initial connections. You will still have the issue of how to provide redundancy at the server level.

For MX set up two A records such as smtp.example.com and smtp2.example.com. Get the pointer records for the IP addresses set accordingly. You can then set these as your MX records. Which server is preferred will be based on the MX priority. It is common to have the same priority on both MX records. If you have different servers behind each IP address, you likely want to set the priority to favor your primary server.