MX FAQs
What Is MX Record Priority?
In an MX (Mail Exchange) record, priority is a number that tells sending mail servers which mail server to try first when delivering email.
The rule is simple: Lower number = higher priority.
This system provides reliability and redundancy. If the preferred mail server is unavailable, sending servers automatically try the next one in line. When multiple servers share the same priority, email traffic can be balanced across them.
How MX Priority Works
-
MX Lookup: When an email is sent to a domain, the sending mail server looks up that domain's MX records.
-
Priority Order: The server sorts the MX records by priority, starting with the lowest number.
-
Delivery Attempt: The sending server tries to deliver the email to the mail server with the highest priority (lowest number).
-
Failover: If delivery fails, the server automatically tries the next MX record with a higher number (lower priority).
-
Load Balancing: If multiple MX records have the same priority, mail servers may distribute incoming email across them.
Example MX Record Setup
10 mailhost1.example.com (Primary server) 10 mailhost3.example.com (Shares primary load) 20 mailhost2.example.com (Backup server)
In this example:
-
Email is delivered to either mailhost1 or mailhost3 first (both priority 10).
-
If both primary servers are unavailable, delivery falls back to mailhost2.
Why MX Priority Matters
-
Ensures reliable email delivery
-
Provides automatic failover
-
Supports load balancing
-
Prevents lost or delayed messages
Best Practices for MX Record Configuration
An effective MX record configuration balances security, reliability, and correct mail routing. This is achieved by using multiple fully qualified domain names (FQDNs) with tiered priority values (e.g., 10 and 20) to support failover and continuity.
Key recommendations include assigning the lowest priority value to the primary mail server, selecting an appropriate Time-To-Live (TTL), and implementing SPF, DKIM, and DMARC records to protect against spoofing and unauthorized email use.
Optimal MX Record Configuration Steps
-
Use FQDNs: Always point MX records to hostnames (e.g., mail.example.com), never directly to IP addresses.
-
Set Priority Levels: Lower numbers indicate higher priority. Use something like 10 for the primary server and 20 or 30 for backup servers to enable failover.
-
Remove Obsolete Records: Delete MX records from previous email providers to prevent routing conflicts or delivery issues.
-
Configure TTL Appropriately: A standard TTL of 3600–86400 seconds provides stability. Temporarily lowering the TTL before switching providers can speed up DNS propagation.
-
Verify Configuration: Use our free MX Lookup tool to confirm that records are correctly configured and resolving as expected.
Sample MX Record Configuration
Be sure to configure the corresponding A records for your mail hostnames and implement SPF, DKIM, and DMARC to ensure secure and trusted email delivery.
What Is MX Record TTL?
An MX record Time to Live (TTL) specifies how long DNS resolvers cache your email server settings—measured in seconds—before checking for updates. A lower TTL (e.g., 300 seconds / 5 minutes) allows changes to propagate quickly when switching email providers, while a higher TTL (such as 3600 seconds / 1 hour) reduces DNS query load during normal operation.
Key Concepts
-
Definition: TTL is a value, in seconds, that tells DNS resolvers how long to retain your current MX record configuration.
-
Caching Behavior: Until the TTL expires, external mail servers continue using cached MX records. If you change providers during this period, some email may still be delivered to the previous server.
-
Typical TTL Values: A TTL of 3600 seconds (1 hour) is common, though values typically range from 300 seconds (5 minutes) to 86,400 seconds (24 hours).
-
Propagation Speed: Lower TTLs (300–600 seconds) are especially important during email migrations, allowing changes to take effect in minutes rather than hours.
Best Practices
-
Before Changing Email Providers: Reduce the MX record TTL to 300–600 seconds at least 24–48 hours before the migration to minimize delivery delays and downtime.
-
After the Migration: Once mail flow is stable, increase the TTL back to 3600 seconds or higher to reduce unnecessary DNS traffic.
MX Record TTL vs. Priority
-
TTL controls how quickly MX record updates propagate across the internet.
-
Priority is a separate MX record field that determines which mail server is tried first when multiple servers are configured (lower numbers indicate higher priority).