My mail server has two WAN interfaces and I need to set up one DNS A record for my Exchange clients. In case of connection failure of one interface I wish to use the other interface, but how to set up a DNS record to let the client choose the working one? Something like happends with MX10/MX20 record for SMTP connections.
- Create an A record with public IP address over WAN interface 1 to, say, mail.something.com
- Create an A record with public IP address over WAN interface 2 to same name, mail.something.com
- Create an MX record to mail.something.com
You have to have two A records which can hold both public IPs over a single FQDN, and then a Mail Exchanger (MX) record to point that FQDN. This way you're actually doing an IP load balancing, not a fail-over. Don't forget to create PTR records for those two public IP addresses, both should point back to mail.something.com, in order to some mail servers deny to communicate with mail server which don't have PTR records.
Not quite sure what your setup actually is, but
two WANs, your own AS: Assign both WAN interfaces the same IP, then ask your routing providers to add a neighbor fall-over or a fast-external fall-over to your edge routers, then have your one A record resolve to the one IP address.
Now the edge routers will monitor the route to your WAN interfaces and communicate any failures to each other
- two WANs, not your own AS or two assigned IP addresses: technically you could also add some BGP fall-overs but since this is not your own AS you would have to ask the AS owner(s) to do the setup in 1 for you (which can be difficult if it's two owners)
- two WANs, two IP addresses, no failovers at the BGP level: You can always assign two A-records to one and the same hostname, then clients would resolve to one of the two addresses and (after a possibly long timeout) might try the other
I know that MX records are good for mail flow (port 25 traffic) but not made for client connections (Outlook).
For client conections, you would need to have a network load balancer (usually sold as an appliance) or use Windows Load Balancing. This will allow either High Availability (HA) or Failover client connections fro your Client Access Server (CAS).
Another option would be to "team" your NICs on the Exchange server for hardware redundency. Here is a Microsoft reference overview on how to team your NICs. By teaming your NICs, you can have one A record but will be able to have multiple IP addresses on that team-NIC setup.