An MX record (mail exchanger) tells other mail servers where to deliver email for a domain. When someone sends a message to you@example.com, their mail server looks up the MX records for example.com and delivers to the server named there. MX records only affect incoming mail, not the website.
What it looks like
| Name | Type | Priority | Value |
|---|---|---|---|
@ | MX | 10 | mx1.mailprovider.example. |
@ | MX | 20 | mx2.mailprovider.example. |
The priority number decides the order: lower is tried first. Equal numbers share the load. If the first server is unavailable, senders try the next. Check a domain’s MX records with:
dig example.com MX +short
Rules and common mistakes
- An MX record must point to a hostname with an A or AAAA record, never directly to an IP address, and never to a CNAME.
- When moving email, remove all the old MX records. A leftover record keeps receiving some of your mail.
- Changing the website’s host does not require touching MX records. Deleting them by accident while editing DNS stops mail arriving, often silently.
- A domain with no MX record falls back to its A record, so mail may be sent to the web server. Domains that never receive mail can publish a “null MX” record (
0 .) to say so.
Moving mail between providers is covered in how to migrate email to a new host.