An MX record, short for mail exchanger, is the DNS record that tells the world which servers receive email for a domain. Each MX record has a hostname and a priority number. When a mail server needs to deliver a message to sam@example.com, it looks up the MX records for example.com and connects to the listed host over SMTP.
How MX records work
- A sending server gets a message for
sam@example.com. - It queries DNS for
example.comtype MX. - It sorts the answers by priority. Per RFC 5321 section 5.1, lower numbers are more preferred.
- It looks up the A or AAAA record of the chosen host and opens an SMTP connection.
- If that host is down, it tries the next one, and keeps retrying for a while if all fail.
If a domain has no MX records at all, RFC 5321 says senders treat the domain’s own address record as an implicit MX. If a domain wants to say “we accept no email”, it publishes a null MX (RFC 7505).
MX record examples
A domain using Google Workspace for its team mailboxes:
example.com. MX 1 smtp.google.com.
A domain with a primary and a backup server:
example.com. MX 10 mx1.example.net.
example.com. MX 20 mx2.example.net.
A subdomain whose mail goes to an app through an inbound email service, leaving the main domain’s mailboxes untouched:
reply.example.com. MX 10 inbound-smtp.us-east-1.amazonaws.com.
A domain that never receives mail:
noreply.example.com. MX 0 .
Why it matters for app email
MX records matter for app email in two ways. First, receiving: if you want your app to handle replies, the MX of a subdomain is the switch that routes them to your code. Second, bouncing: your envelope sender, the Return-Path, is often a subdomain like send.example.com with its own MX, so that bounce reports have a server to land on. Some receivers are also wary of mail from domains that could never accept a reply.
Common mistakes
- Changing the root domain’s MX for an app feature and cutting off everyone’s inbox. Use a subdomain.
- Pointing MX at an IP address or a CNAME. It must be a hostname with A or AAAA records.
- Adding the domain twice, ending up with
mx.example.com.example.combecause the DNS host appends the zone. - Mixing a null MX with other MX records, which RFC 7505 forbids.
- Leaving old MX records from a previous provider, so some mail goes to a server nobody checks.
Look up any domain’s MX records with our tools.
How Mailcandor handles it
Mailcandor uses a bounce MX on send.<domain> for outbound mail, and for inbound you point a domain’s MX at inbound-smtp.us-east-1.amazonaws.com.