What is an MX record? How email finds your mail server
An MX record tells the internet which server takes your domain's email. Here's how senders use it, what the priority number means, and what happens when there isn't one.
An MX record is the DNS record that tells the internet which server receives email for a domain. When someone sends mail to you@example.com, their mail server looks up the MX records for example.com and delivers the message to the server named there.
Every domain that receives email needs one. This guide sticks to the standard that defines how MX records are used, RFC 5321, section 5.1, plus RFC 7505 for domains that take no mail at all.
What is an MX record?
MX stands for mail exchanger. An MX record lives in your domain's DNS and has two parts: a preference number and the name of a mail server.
example.com. 3600 IN MX 10 mail.example.com.That says: mail for example.com goes to mail.example.com, with a preference of 10. The 3600 is the time to live, how many seconds other servers may cache the answer.
How does email find your MX record?
RFC 5321 says that once a sending server knows the domain a message is going to, "the lookup first attempts to locate an MX record associated with the name." It then connects to the server the record names and hands the message over.
You can run the same lookup yourself:
dig MX example.com +shortEach line that comes back is one MX record: a number and a server name.
What does the MX priority number mean?
It sets the order servers are tried in, and lower wins. In RFC 5321's words: "Lower numbers are more preferred than higher ones."
So with these two records, senders try mx1 first and use mx2 only if mx1 can't take the message:
example.com. MX 10 mx1.example.com.
example.com. MX 20 mx2.example.com.The numbers themselves don't matter, only their order. 10 and 20 behave the same as 1 and 2.
If two records share the same number, senders spread the load. RFC 5321 says the sender "MUST randomize them to spread the load across multiple mail exchangers."
What happens if a domain has no MX record?
Mail can still arrive, at the domain's own address. RFC 5321 says that if no MX records come back, "the address is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host." The sender delivers to the domain's A or AAAA record instead.
That fallback is why a domain that never sends or receives email can still get mail attempts. To say "no mail here," publish a null MX.
What is a null MX record?
A way to say a domain accepts no email. RFC 7505 defines it as a single MX record with preference 0 and an empty server name, written as a dot:
example.com. MX 0 .Mail to that domain then fails at once instead of being tried and retried. RFC 7505 says a domain with a null MX "MUST NOT advertise any other MX RR."
Can an MX record point to an IP address or a CNAME?
No to both. RFC 5321 says the data in an MX record "MUST contain a domain name," and that name "MUST return at least one address record (e.g., A or AAAA RR)." A name that returns a CNAME "lies outside the scope of this Standard."
So point the MX at a hostname, and give that hostname an A or AAAA record.
How do MX records work with an email API?
The same way. To receive mail at your own domain through an email API, you point your domain's MX record at the provider's mail server, and the provider turns each incoming message into something your code can read. What is an email API? explains the rest.
With ACK, you add a domain and ACK gives you every DNS record it needs. On the agents page, the example domain gets:
Table: Example DNS records for a domain on ACK
| Type | Name | Value |
|---|---|---|
| MX | lumen.studio | 10 mx.ack.now |
| CNAME | ps1._domainkey | 407.customers.postshiba.com |
| CNAME | rp | rp.postshiba.com |
| TXT | _dmarc | v=DMARC1; p=none |
The MX record is what makes the domain receive. If your domain already gets its email somewhere else, such as Google Workspace, create it as send-only (inbound_enabled: false): ACK leaves out the MX record and your current provider keeps receiving. Inboxes on a send-only domain can still send.
ACK can also receive at any subdomain of your domain. Turn on subdomains_enabled and ACK adds a wildcard MX record (*.<domain>) to the list.
FAQ
What is an MX record?
The DNS record that names the server that receives email for a domain, with a preference number that sets the order servers are tried.
Is a lower or higher MX priority better?
Lower. RFC 5321: "Lower numbers are more preferred than higher ones."
Do I need an MX record to send email?
Not to send. The MX record is how other servers find where to deliver mail to you. Sending uses other records, such as DKIM and SPF, which prove the mail is really yours.
Can I have more than one MX record?
Yes. Senders try the lowest number first and fall back to the next. Records with the same number share the load.
How long does an MX change take?
Up to the old record's time to live (the TTL, in seconds), because other servers can keep using a cached answer until it expires. Lower the TTL a day before you switch if you want the change to land quickly.
Give your agent its own inbox
ACK gives each agent its own email inbox, with threads, signed webhooks and drafts a person approves. It's $19 per organisation a month with 10 inboxes. The developer quickstart gets you to a first reply in four requests. Start a trial.