In DNS configuration, MX (Mail Exchange) record priorities determine the order in which mail servers should be attempted when delivering email. The lower the numerical value, the higher the priority. Here's what each value means in your example:
0 - Highest priority (typically reserved for primary mail servers)
1 - Secondary priority
5 - Medium priority (group 1)
5 - Medium priority (group 1)
10 - Lower priority (group 2)
10 - Lower priority (group 2)
Google's suggestion of using "1st, 1st, 3rd, 3rd" is essentially the same concept expressed in ordinal terms rather than numerical values. The mapping works like this:
- "1st" corresponds to priority 0 or 1
- "2nd" would correspond to priority 5
- "3rd" corresponds to priority 10
Regarding your question about whether 0,1,2,2,3,3 acts the same as 0,1,5,5,10,10 - the answer is yes, in terms of relative ordering. The specific numbers don't matter as much as their relative values. What's important is the grouping:
# Both these configurations provide identical mail server fallback behavior:
# Scheme 1
0 (primary)
1 (secondary)
5 (tertiary group 1)
5 (tertiary group 1)
10 (quaternary group)
10 (quaternary group)
# Scheme 2
0 (primary)
1 (secondary)
2 (tertiary group 1)
2 (tertiary group 1)
3 (quaternary group)
3 (quaternary group)
Here's how this might look in actual DNS zone files:
; Numerical priority scheme
example.com. IN MX 0 mail1.example.com.
example.com. IN MX 1 mail2.example.com.
example.com. IN MX 5 mail3.example.com.
example.com. IN MX 5 mail4.example.com.
example.com. IN MX 10 mail5.example.com.
example.com. IN MX 10 mail6.example.com.
; Equivalent ordinal scheme
example.com. IN MX 0 mail1.example.com. ; 1st
example.com. IN MX 0 mail2.example.com. ; 1st
example.com. IN MX 10 mail3.example.com. ; 3rd
example.com. IN MX 10 mail4.example.com. ; 3rd
When implementing MX records:
- Always have at least two MX records for redundancy
- The numerical gap between groups doesn't matter (0,1,2 vs 0,1,100)
- Servers with equal priority will be tried in random order
- Modern systems typically use small numbers (0-100 range)
You can verify your MX record priorities using dig:
dig MX example.com +short
# Expected output shows records in priority order
0 mail1.example.com.
1 mail2.example.com.
5 mail3.example.com.
5 mail4.example.com.
10 mail5.example.com.
10 mail6.example.com.
MX (Mail Exchange) record priorities determine the order in which mail servers attempt to deliver emails. Lower numerical values indicate higher priority. Here's how the numbering system works:
- 0 (Highest Priority): The mail server with priority 0 will always be attempted first
- 1: Second-tier backup server
- 5, 10, etc.: Progressively lower priority servers
The systems 0,1,5,5,10,10
and 0,1,2,2,3,3
are functionally equivalent in terms of delivery order:
// Both configurations produce identical delivery sequences:
1. Try priority 0 server
2. If unavailable, try priority 1
3. If still unavailable, try the first priority 2/5
4. Next try the second priority 2/5
5. Then first priority 3/10
6. Finally second priority 3/10
Here's how to implement these priorities in different DNS systems:
BIND Zone File Example:
example.com. IN MX 0 mail1.example.com.
example.com. IN MX 1 mail2.example.com.
example.com. IN MX 5 mail3.example.com.
example.com. IN MX 5 mail4.example.com.
example.com. IN MX 10 mail5.example.com.
example.com. IN MX 10 mail6.example.com.
Terraform Configuration for AWS Route53:
resource "aws_route53_record" "mx" {
zone_id = aws_route53_zone.primary.zone_id
name = "example.com"
type = "MX"
ttl = "300"
records = [
"10 mail1.example.com",
"20 mail2.example.com",
"50 mail3.example.com",
"50 mail4.example.com"
]
}
Developers typically use these priority schemes:
- Primary/Secondary: 0,10 (simple fallback)
- Primary/Secondary/Tertiary: 0,5,10
- Load Balanced: 5,5,5 (equal priority for multiple servers)
You can verify MX record priorities using dig:
dig MX example.com +short | sort -n
Or with this Python script to check priorities:
import dns.resolver
def check_mx_priorities(domain):
try:
answers = dns.resolver.resolve(domain, 'MX')
sorted_mx = sorted(answers, key=lambda x: x.preference)
for rdata in sorted_mx:
print(f'Priority {rdata.preference}: {rdata.exchange}')
except Exception as e:
print(f"Error: {e}")
check_mx_priorities("example.com")
While 0,1,2,2,3,3 works, using larger gaps (0,1,5,5,10,10) is preferred because:
- Clearly shows priority tiers
- Leaves room for future intermediate servers
- Standard practice in most documentation