# What Is an MX Record? Mail Exchanger Records Explained

URL: https://email-validation.org/glossary/mx-record/
Updated: 2026-11-25

> Documentation index: https://email-validation.org/llms.txt

An MX record (mail exchanger record) is a DNS record that tells other mail servers which host accepts email for a
domain. Each MX record holds a priority number and a host name; senders try the lowest number first. A domain with
no MX records can still receive mail through its address record, and a domain that wants no mail at all publishes a
"null MX".

## What an MX record looks like

An MX record has two parts after the type: the preference (a number, lower means preferred) and the exchange (the
host name of a mail server).

```text
example.com.   3600   IN   MX   10   mx1.example.com.
example.com.   3600   IN   MX   20   mx2.example.com.
```

Here, servers sending to anyone at `example.com` try `mx1.example.com` first. If it does not answer, they try
`mx2.example.com`. The `3600` is the time to live: how many seconds resolvers may cache the answer.

## How senders use MX records

[RFC 5321](https://www.rfc-editor.org/info/rfc5321/), section 5.1, sets the order a sending server follows:

1. Look up the MX records of the domain after the `@`.
2. Try the hosts in order of preference, lowest number first.
3. Where several records share the same preference, pick among them at random, which spreads the load.
4. If the domain has no MX records at all, treat the domain's own address record (A or AAAA) as an implicit MX with
   preference 0.

The exchange must be a host name that resolves to at least one address. It must not be an alias (a CNAME):
[RFC 2181](https://www.rfc-editor.org/info/rfc2181/), section 10.3, forbids it, and RFC 5321 places
it outside its scope. Point MX records at a host with its own A or AAAA record.

## How to look up an MX record

On macOS or Linux, `dig` prints a domain's MX records with their preferences:

```bash
dig MX example.com +short
```

On Windows, `nslookup -type=mx example.com` gives the same answer. Our free [MX lookup](https://email-validation.org/tools/mx-lookup/) shows them
in a browser and checks that each mail server has a public address. An empty answer means the domain publishes no MX
records; whether it can still receive mail then depends on its address record, as described above.

## Common MX mistakes

- **An exchange that does not resolve.** The host name in the MX record has no A or AAAA record, often after a server
  was retired. Senders cannot connect to it, so the mail is delayed or bounced.
- **An IP address as the exchange.** The exchange must be a host name. Publish an A record for the mail server and
  name it in the MX record.
- **An alias as the exchange.** RFC 2181 forbids a CNAME as the exchange, and not every sender
  follows one.
- **Old records after a move.** When a domain moves to a new mail provider, records that still point at the old one
  send part of the mail to a server that no longer accepts it. Remove them once the new ones are in place.
- **A null MX next to real records.** A domain that accepts no mail publishes one record, `MX 0 .`, and nothing else
  ([RFC 7505](https://www.rfc-editor.org/info/rfc7505/), section 3). See [null MX](https://email-validation.org/guides/null-mx/) for the whole
  record set of a domain without email.

## MX records and email verification

An email check starts with the domain: if no server is set up to take mail for it, no address there can receive a
message. Our check reports such an address as [invalid](https://email-validation.org/docs/statuses/invalid/), with the reason
[`no_dns`](https://email-validation.org/docs/statuses/invalid/#no_dns) when the domain has no records that tell senders where to deliver, or
[`no_inbound_mail`](https://email-validation.org/docs/statuses/invalid/#no_inbound_mail) when it turns incoming mail away. A working MX record
is not proof that a mailbox exists: the next step asks the mail server about the address itself, as
[verifying an email without sending one](https://email-validation.org/guides/verify-email-without-sending/) explains.

MX records only receive mail. Which servers may send mail for a domain is a different record, SPF: check it with our
[SPF checker](https://email-validation.org/tools/spf-checker/).

## Questions

### Can a domain receive email without an MX record?

Yes, if it has an A or AAAA record and a mail server listens at that address: senders then use the address record as
an implicit MX (RFC 5321, section 5.1). Most domains that receive mail publish MX records anyway, so the mail host can
differ from the web host.

### Why have more than one MX record?

For backup and load sharing. Records with a higher number take mail when the preferred hosts do not answer; records
with the same number share the load. A backup host must accept mail for the same addresses as the main one, or it
turns a delay into a bounce.

### How long does an MX change take to work?

Resolvers that cached the old answer keep using it until its time to live runs out. Lowering the TTL ahead of a planned move,
at least one old TTL before it, shortens the overlap.

## Related

- [Glossary: all terms](https://email-validation.org/glossary/)
- [Null MX: the record for domains that accept no mail](https://email-validation.org/guides/null-mx/)
- [Verify an email address without sending one](https://email-validation.org/guides/verify-email-without-sending/)
- [Bounce code 556 5.1.10: recipient address has null MX](https://email-validation.org/bounce-codes/556-5-1-10/)

## Sources

- [RFC Editor: RFC 5321, Simple Mail Transfer Protocol](https://www.rfc-editor.org/info/rfc5321/) (read 2026-11-16):
  locating the target host, preference order, the implicit MX and alias targets (section 5.1).
- [RFC Editor: RFC 2181, Clarifications to the DNS Specification](https://www.rfc-editor.org/info/rfc2181/)
  (read 2026-11-16): an MX record must not point to an alias (section 10.3).
- [RFC Editor: RFC 7505, A "Null MX" No Service Resource Record](https://www.rfc-editor.org/info/rfc7505/)
  (read 2026-11-16): the record and the rule that it stands alone (section 3), the 556 5.1.10 reply (section 4.1).

_How we wrote this: drafted by the email-validation.org team with the help of AI writing tools, from our product documentation and the sources linked in the text._

## Get up to 500 free credits. No card needed.

New accounts get 500 free credits (100 when you sign up with a free email provider such as Gmail, Outlook or Yahoo, another personal mailbox such as a paid one like Fastmail or one from your internet provider, or an address from a relay or alias service). Try it on your own list before you buy. [Create your account](https://email-validation.org/signin/?new=1) or [open the free email checker](https://email-validation.org/email-checker/).
