What is an MX record for a domain?
MX stands for mail exchanger. When someone sends a message to team@example.com, their mail server looks up the MX records for example.com. It then opens an SMTP connection to the server listed with the lowest priority.
| Quick facts | |
|---|---|
| RR type number | 15 |
| Defined in | RFC 1035; delivery rules in RFC 5321 §5.1 |
| Holds | A preference number and a mail server hostname |
| Usual location | The zone apex, sometimes a mail subdomain |
| Auto TTL in Bridge DNS | 120 seconds |
| Proxy switch in Bridge | No, mail is never proxied |
MX syntax
@ 120 IN MX 10 mx1.example.net.
@ 120 IN MX 20 mx2.example.net.
The fields are the owner name, TTL, class, type, preference and the mail server hostname. The target must be a hostname with its own A or AAAA records. It can't be an IP address, and it must not be a CNAME alias (RFC 2181 §10.3).
How MX priority works
The preference number decides the order. Lower means preferred. A sender tries 10 before 20, and moves on only if 10 doesn't answer.
Two records with the same number share the load. Senders pick between them at random, which is how many hosted providers spread incoming mail.
So which MX priority should you choose? Use the exact values your mail provider gives you. Google Workspace, Microsoft 365 and most others publish a fixed set. Don't invent a "backup" record pointing at a server that isn't set up to accept your mail. Spammers love weak backup MX hosts, and legitimate mail may get stuck there.
How to add MX records in Bridge DNS
- Open the zone and choose Add record.
- Pick MX.
- Use
@for the domain itself, or the subdomain that receives mail. - Enter the priority and the mail server hostname from your provider.
- Repeat for each server your provider lists.
- Delete MX records left over from your previous email service.
- Save. Our nameservers answer with the new set within seconds.
Mail also needs SPF, DKIM and DMARC records, which are TXT records or CNAMEs. The email DNS guide covers all four together, and the TXT record reference explains the format.
How to look up MX records
People searching for how to check MX record values usually need one command:
dig example.com MX +short
10 mx1.example.net.
20 mx2.example.net.
On Windows, nslookup -type=mx example.com gives the same list. To see what Bridge serves before resolvers update, add @ns1.bb-ns.com to the dig command.
Switching email providers without losing mail
Moving from one mail host to another is mostly an MX change, but the order matters. First, set up the new mailboxes and verify the domain with the new provider, usually through a TXT record. Then replace the old MX set with the new one in a single edit, so senders never see a mix. Keep the old mailboxes open for a few days to catch anything delivered by servers that cached the previous answer.
Email not arriving? Troubleshooting MX
When mail stops, check these in order:
- The old MX records are still there. Senders split mail between old and new servers. Delete the old set.
- The target is a CNAME or an IP address. Strict senders refuse it. Point the record at a hostname with its own A or AAAA record.
- The target hostname doesn't resolve. Run
dig mx1.example.net Aand make sure it returns an address. - A typo in the hostname. Copy and paste from the provider instead of typing.
- The mail host was proxied. If you pointed the MX at a name of your own, keep that name's A record DNS-only.
- Recent change. Senders may still hold the previous answer until its TTL expires. On Auto, that's two minutes.
If MX looks right and mail is still rejected, read the bounce message. It usually names an SPF, DKIM or DMARC failure rather than a routing problem.
MX vs the address fallback and null MX
If a domain has no MX records at all, RFC 5321 tells senders to fall back to the domain's own A or AAAA record and try delivering there. That's rarely what you want, because your web server probably doesn't accept mail.
For a domain that never receives email, publish a null MX instead (RFC 7505):
@ 120 IN MX 0 .
It tells senders to give up immediately and bounce, instead of retrying for days.
Questions about MX and mail routing
What is an MX record in DNS?
An MX record is a DNS entry that names the mail servers accepting email for a domain, each with a priority number. Sending servers look it up before every delivery.
What does an MX entry look like?
It has a priority and a hostname, for example 10 mx1.example.net.. In a zone file, the full line includes the owner name, TTL, class and the type MX.
How do I find the MX record for a domain?
Run dig example.com MX +short, or nslookup -type=mx example.com on Windows. Online lookup tools show the same data.
Can MX point to an IP address?
No. The MX target must be a hostname that has its own A or AAAA records. It also must not be a CNAME.
What happens if a domain has no MX records?
Senders fall back to the domain's A or AAAA record and try to deliver there. For domains that should never receive mail, publish a null MX so senders stop trying.
See also the DNS record types.