# MX Record Priorities

What does do each of the values 0, 1, 5, 5, 10, 10 mean?

Google says you can do that or use 1st 1st 3rd 3rd <-- how are these different or the same?

Will 0,1,2,2,3,3 act the same as 0, 1, 5, 5, 10, 10 ?

-

## 3 Answers

lower number means is the most preferred mail server, see RFC 5321 if your really interested. You can use 1, 2, 3 & achieve the same thing as 10,50,100. makes no difference.

Yes, 0,1,2,2,3,3 will act the same as 0, 1, 5, 5, 10, 10

-

Generally, SMTP clients try to contact the MX server with the highest preference (or smallest distance, hence the lower numbers). When there is more than one MX record of the same priority, SMTP clients are expected to randomly select one of those. This is an easy and effective method of load balancing.

Higher number means a lower priority, these would be used (and randomized again) when higher priority servers don't respond.

Should you mean that you can really state "1st, 2nd" etc as priority value: I have never heard of that.

Anyway, in your example, a client would first try to contact the priority 0 server, if this fails try the 1, then randomly select one of the 5s, then the other and if it still hadn't any luck, would delay/fail the transfer.

Edit: Yes, the two variants mean the same, but I would recommend using steps of at least 5 between them, which makes it possible to insert additional servers with priorities between the present without having to edit all entries. Granted, this should be extremely rare, but still :)

-
Can you start at 0, I've heard conflicting reports? –  Steven Sep 4 '10 at 10:58
I never use the 0, always start at 10, but I am not really sure. I know though that the absence of an MX record would force the SMTP server to treat the A record for the domain as an MX with priority 0, so I guess it should be OK. –  Sven Sep 4 '10 at 11:08

MaileXchanger (MX) priorities are given as integer numbers. Lowest number is most preferred. If 2 MX's have the same number then other mail servers should pick one at random. It is normal an recommended to have at least 2 MX's for a domain, fx a primary MX hosted on premises and a backup MX somewhere else which temporarily stores mails for you if your primary MX is down.

Google, operating a large email system, of course uses multiple MXs, and each of these is probably a load balanced cluster of servers.

How you set up the MX records for your own domain is your own choice, but Google's recommendation is sound and good. There is an old habit amongst sysadmins is to always leave some 'space for future expansion'. That's probably why Google increments MX priorities by 5, to leave some un-used numbers now that can be used for future MX clusters if needed.

Google says you can do that or use 1st 1st 3rd 3rd

Mnn, no I don't think so? Where did you read that; I think you may have misunderstood their docs...

If you want to know more about MX records in DNS, then RFC 974 should be your first stop. But really, there is no need -- just follow Google's recommendation. And while you're editing DNS, remember the SPF records.

-