What is MX Record
Introduction
In the world of domain name system (DNS) records, the MX (Mail Exchange) record plays a crucial role in ensuring that emails sent to your domain reach the correct mail server. Think of it as the postal code for your email address. The MX record specifies which server is responsible for receiving email messages addressed to your domain and dictates how these messages should be delivered using the standard SMTP (Simple Mail Transfer Protocol). Similar to CNAME records, an MX record doesn't point directly to an IP address but rather to another domain name that represents the mail server.
Anatomy of an MX Record:
A typical MX record entry contains several key components. Here's an example illustrating these elements:
Name/Host |
Type |
Priority |
Value |
@ |
MX |
10 |
mailhost1.example.com |
@ |
MX |
20 |
mailhost2.example.com |
Let's break down each part:
- Name/Host (@): This field usually represents your domain name itself. The "@" symbol is often used as a shorthand for the current domain.
- Type (MX): This clearly identifies the record as an MX record.
- Priority (10, 20): The "Priority" number is a crucial element that determines the order in which mail servers are attempted for email delivery. A lower priority number indicates a higher preference. In the example above,
mailhost1.example.com
(priority 10) will be the primary mail server. If this server is unavailable or fails to respond, the sending server will then attempt delivery tomailhost2.example.com
(priority 20). While the priority number is standard, its implementation can sometimes be optional depending on the specific mail server configuration. - Value (mailhost1.example.com): This field specifies the domain name of the mail server responsible for receiving emails for your domain.
Priority in Action:
The priority mechanism provides redundancy and ensures reliable email delivery. If the primary mail server (with the lowest priority number) experiences downtime or is unreachable, the sending server will automatically fall back to the secondary mail server (with the next higher priority number), and so on. This system minimizes the risk of email delivery failures.
Examples from Popular Email Providers:
Different email service providers may utilize varying numbers and ranges of priority levels for their MX records. Here are examples from Google Workspace and Ionos:
Google Workspace MX Records:
Name/Host |
Time to Live (TTL) |
Type |
Value |
@ |
3600 |
1 |
ASPMX.L.GOOGLE.COM |
@ |
3600 |
5 |
ALT1.ASPMX.L.GOOGLE.COM |
@ |
3600 |
5 |
ALT2.ASPMX.L.GOOGLE.COM |
@ |
3600 |
10 |
ALT3.ASPMX.L.GOOGLE.COM |
@ |
3600 |
10 |
ALT4.ASPMX.L.GOOGLE.COM |
Google Workspace employs five MX records with priorities ranging from 1 to 10, ensuring robust email delivery through multiple servers.
Crucial Step When Pointing Your Domain:
If you had an existing mail server configured for your domain before you point your domain to our Cloudflare nameservers, it is absolutely essential that you provide the MX records of your current mail host to our support team. This allows us to correctly add these records to the DNS zone for your domain.
Failure to provide your MX records to our support team will result in your email service ceasing to function after you point your domain to us. This can lead to significant disruptions in your communication with clients and other important contacts.
To learn more about the domain change process and other relevant DNS settings, we encourage you to review our comprehensive article: Domain Change: How can I proceed to change my domain. This resource provides further details on managing your domain and ensuring a smooth transition.