HOWTO - Configure Mail Servers fail-over

This HOWTO configures a DNS server to provide a 'kinda' fail-over service when the primary mail service is off-line.

Define MX records with different priorities e.g.

; zone file fragment
      IN  MX  10
      IN  MX  20
mail  IN  A

If the most preferred mail server ( is down, mail should be sent to the alternate server ( The server, which in the fragment above is external to the domain and ideally at a separate geographic location, would typically configured as a simple relay (or forwarder) with a very long retry time in which case it will accept the mail and try and relay it to the proper destination ( over the next six weeks or whatever you configure the retry time to be.

Beware: There are a number of articles around the web which suggest that most mail systems do a poor job of using the 'preference system of the MX record.

Pro DNS and BIND by Ron Aitchison


tech info
guides home
dns articles
1 objectives
big picture
2 concepts
3 reverse map
4 dns types
5 install bind
6 samples
7 named.conf
8 dns records
9 howtos
10 tools
11 trouble
12 bind api's
13 dns security
bits & bytes
15 messages
notes & tips
registration FAQ
dns resources
dns rfc's
change log