📬 MX Record Priority Sorter

Paste one MX record per line as priority hostname (or priority hostname. TTL) to see the order mail servers will actually be tried in — lowest priority number first.

What the sort is doing

Each line is read with one pattern - a number, whitespace, then a hostname - and the list is sorted by that number, ascending, in your browser. A trailing dot is stripped, anything after the hostname is ignored, and any line that does not start with a number is listed as skipped. So paste the two fields only, not a whole zone line:

10 mail1.example.com      <- parses
20 mail2.example.com
example.com. IN MX 10 mail1.example.com.   <- skipped, starts with a name

The sample set sorts to mail1 and mail1b (both 10), then mail2 (20), then backup-mail (50).

Lower number, higher preference

The number is a preference, not a rank: a sender tries the lowest number first and only moves on when that host refuses the connection or times out. Equal numbers are picked between at random, which is how two servers on 10 share the load. The absolute values mean nothing - 10/20/50 behaves exactly like 1/2/3.

An MX record must name a host that has its own A or AAAA record. Pointing one at an IP address is invalid, and RFC 2181 forbids pointing one at a CNAME - many mail servers will simply refuse to deliver.

Frequently asked questions

What does MX priority 10 versus 20 mean?

10 is tried first. The lower number wins, so 20 is the fallback that only receives mail when the 10 host is unreachable. Both work; you are choosing an order, not a quality.

Can an MX record point to an IP address?

No. The value has to be a hostname, which the sender then resolves to an address. Create mail.example.com as an A record and point the MX at that name.

Do I need a backup MX record?

Usually not. A sending server already retries a failed delivery for several days, so a second MX adds little unless it is run by the same provider. A badly configured backup mostly collects spam and misdirected bounces.