An MX record (Mail Exchanger) is an entry in your domain's DNS that tells the internet which mail server should receive messages sent to any @yourdomain.com address. Without it, your domain cannot receive email.
Below we explain exactly how it works, what each field means, and what happens when something goes wrong.
What Is an MX Record For?
Every time someone sends an email to [email protected], the sender's SMTP server makes a DNS query to the domain yourcompany.com and asks: "Which mail server should I deliver this message to?"
The MX record answers that question. Without it, the sending server has no idea where to route the message, and the email bounces with an error like "No MX or A record for domain."
In short, the MX record is the digital equivalent of the physical address of your mailroom.
Anatomy of an MX Record
A typical MX record looks like this in a DNS panel:
Type Name Priority Value
MX @ 10 mail.yourcompany.com
MX @ 20 mail2.yourcompany.com
Here is what each field means:
Type
Always MX. This distinguishes it from other DNS record types like A, CNAME, or TXT.
Name
Usually @, representing the root domain (yourcompany.com). It can also be the full domain name or a subdomain.
Priority (Preference)
An integer (typically between 0 and 100). The lower the number, the higher the priority. The sending server tries the MX with priority 10 first; if that fails, it tries the one with priority 20 (the backup server).
Value (Target)
The hostname of the mail server that will receive messages. It must be a hostname, never a direct IP address. The hostname in turn has its own A or AAAA record pointing to the mail server's actual IP.
How It Works Step by Step
Suppose [email protected] sends an email to [email protected]. Here is what happens:
- Gmail's SMTP server queries the MX records of
yourcompany.com. - It gets back:
mail.yourcompany.comwith priority 10. - It resolves the IP of
mail.yourcompany.comvia the DNS A record. - It opens an SMTP connection (port 25) to that IP and delivers the message.
- Your company's mail server deposits it in the
salesmailbox.
This entire process takes seconds and is completely transparent to the end user.
Multiple MX Records: Redundancy and Failover
Most serious email providers use more than one MX record to ensure availability:
| Priority | Server | Role |
|---|---|---|
| 10 | mail1.provider.com | Primary server (first choice) |
| 20 | mail2.provider.com | Secondary server (backup) |
| 30 | mail3.provider.com | Tertiary server (last resort) |
If the primary server doesn't respond, the sending server automatically tries the next one in priority order. This minimizes email loss during maintenance windows or outages.
Google Workspace, for example, uses five MX records (aspmx.l.google.com at priority 1 through alt4.aspmx.l.google.com at priority 50).
When and How to Configure an MX Record
You need to configure or update your MX records in these situations:
- When setting up professional email hosting for the first time.
- When switching hosting or email providers.
- When migrating from cPanel email to Google Workspace or Microsoft 365.
- When adding a cloud-based spam filtering service (like Proofpoint or Mimecast).
The MX record is typically edited in the DNS panel where you registered your domain (the registrar), not in your email hosting control panel. The typical process in cPanel is:
- Go to Zone Editor in your DNS settings.
- Locate the existing MX records.
- Delete the old ones and add the new ones provided by your email provider.
- Wait for DNS propagation (between 15 minutes and 48 hours, usually under an hour).
If you manage your domain through a provider like elenlace.com, their technical support team can walk you through the setup step by step with no risk of losing mail during the transition.
MX Record and Related Records: SPF, DKIM, and DMARC
The MX record controls incoming email. To ensure that email sent from your domain doesn't end up in spam, you also need:
- SPF (TXT record): lists the servers authorized to send on behalf of your domain.
- DKIM: a cryptographic signature that verifies the message was not altered in transit.
- DMARC: a policy that tells receiving servers what to do with messages that fail SPF or DKIM checks.
These three records work together with your MX record to ensure your email lands in the inbox. You can learn more in our business email resource section.
Common Mistakes in MX Record Configuration
- Pointing directly to an IP in the value field — not allowed by the standard; it must always be a hostname.
- Leaving old MX records alongside the new ones, causing erratic delivery behavior.
- TTL set too high before a change: if TTL is 24 hours, propagation will take that long. Lower it to 300–600 seconds a few hours beforehand.
- Not verifying propagation: tools like MXToolbox let you confirm the records are visible from multiple points worldwide.
Key Takeaways
- The MX record is the DNS entry that tells the internet which mail server to send messages to for your domain.
- It always points to a hostname, never directly to an IP address.
- Priority (lower number = higher priority) lets you define primary and backup servers.
- Multiple MX records provide redundancy: if one fails, the next one takes over.
- Edit it in your domain registrar's DNS panel, not in your hosting control panel.
- Pair your MX record with SPF, DKIM, and DMARC to keep outgoing email out of spam folders.
Need help configuring your MX records or migrating to professional email? The team at elenlace.com handles the full setup so you don't lose a single message during the process.
FAQ
How long does an MX record change take to propagate?
DNS propagation varies between a few minutes and 48 hours, depending on the TTL (Time To Live) that was set before the change. With a low TTL (300–600 seconds), most servers worldwide will pick up the change in under an hour.
Can I host email with one provider and my website with another?
Yes. The MX record is independent of the A record (which points to your website). You can host your site on one server and your email on Google Workspace, Microsoft 365, or any other provider without them interfering with each other.
What happens if I have no MX record configured?
Emails sent to any address at your domain will bounce with an error like "No MX record found." No one will be able to send you messages to that domain until you configure at least one MX record.
How can I check my current MX records?
You can use free tools like MXToolbox (mxtoolbox.com) or run nslookup -type=MX yourdomain.com from any terminal. These tools show all MX records for the domain and their priority values in real time.
Compare providers
Other providers and guides worth comparing: