Prioritizing among MX records

Edvard Tuinder listbind at lunytune.nl
Mon Mar 8 13:24:46 UTC 2004


According to Jan Koz?nek:
> Hello,
> 
> I'd like to ask if anyone knows whether numbers in MX records are just 
> positional values or real priority numbers.
> 
> Let's say we have an example like this:
> 
> bogus.com.    IN    MX    10    primary.bogus.com.
> bogus.com.    IN    MX    60    backup.bogus.com.
> bogus.com.    IN    MX    65    last-hope.bogus.com.
> 
> Does it mean anything else than that under any circumstances, if mail 
> relay will fail with primary.bogus.com, relaying will be tried to 
> backup.bogus.com IMMEDIATELY and if that fails, it will be IMMEDIATELY 
> tried to last-hope.bogus.com?

That is the way it is supposed to be yes. If the primary MX fails, that is,
it gives a time-out or a temporary error, may/should attempt any of the
lower-preference MX hosts. This is mostly specified in rfc2821 chapter 5.

Allthough the IMMEDIATELY is not required, so I guess an implemenation may
decide to requeue a message for a later retry at a lower preference MX. Most
well known implemenations (postfix/qmail/sendmail) do immediately try at the
other MX.


> Is number of delivery retries to each of the mail servers dependent 
> solely on the sending SMTP server's software?

Yes, the recipient SMTP server can not directly influence the behaviour
of the sender SMTP server. The recipient SMTP may rejeect any server with
a temporary error, thus causing the sender to retry at another MX host,
but it should be noted that not all implemenations of SMTP sender software
fully understand (or implement) the relevant rfc specifications.

I have seen several packages retry at all MX hosts even if they receive a
5xx error message, such as user-unknown. Some seem to try to deliver the
message indefinitely, in spite of the 5xx error message, some just try to
deliver the message to all MX's and stop only after the last MX has given
them the same 5xx error.


> Reason for my question is that some time ago I found a material quoting 
> that the priority number in a way affects also the number of failed 
> retries a relaying SMTP will try with each mailserver, before falling 
> back to the one with lower (higher number) priority. And, to my 
> surprise, while testing, I discovered corelating speed-ups/speed-downs, 
> which could justify the above statement.

This is entirely dependant on the implementation. There is no such speficiation
in either 821 nor 2821.


-Ed


More information about the bind-users mailing list