Failover for server with dual WAN

domain-name-systememailfailoverload balancing

I have one mail server, one SonicWall firewall, two Internet providers, and an internal DNS server. I have WAN failover set up on the SonicWall so in the event that the primary connection is down users will get out on the secondary connection. The mail server is accessible from outside via either ISP.

mail.mydomain.com uses the primary Internet connection, and is the primary MX record.

mail2.mydomain.com uses the secondary Internet connection, and is the secondary MX record.

Webmail, mail clients and smartphones can use either address to connect when outside the LAN (only mail.mydomain.com works internally because of the internal DNS server), but when the primary ISP is down users need to know to use mail2.mydomain.com and smartphones don't connect as they are configured for mail.mydomain.com

I'd like to automatically detect when the primary Internet connection is down so mail.mydomain.com connects over either WAN connection.

I think BGP and DNS failover are my options, and I'm wondering if a load balancer is a possible solution and how that would fit into the setup. BGP is not an option with the internet providers I have. DNS failover with dyn.com or dnsmadeeasy.com is an option, but I'm concerned that the user's ISPs won't respect the short TTL and this won't be effective for short outages.

Best Answer

If you place the load balancing function outside your wan links such that it has its own public ip address(external to your network) to point your clients at, you can configure it to reverse-proxy to services at both your wan link ip addresses. Such a design would make for load balancing and failover without bgp.

I guess you could co-locate a redundant load balancer, use a cloud service or similar, as long as you procure for very high uptime. You would ideally want it to be more reliable than both your wan links when seen as a bundle.

Related Topic