Glossary / MX record
MX record (mail exchanger)
An MX (mail exchanger) record tells other mail servers which server accepts email for a domain. When someone writes to you@example.com, their mail server looks up the MX record for example.com and delivers the message there. Without an MX record, sending servers fall back to the domain's A record, which rarely points to a mail server, so in practice the mail does not arrive.
Check your site
An MX record holds the hostname of a mail server (such as aspmx.l.google.com) rather than an IP address, and that hostname has its own A record. Next to the name sits a number, the priority. The lower the number, the more preferred the server. Backup servers get a higher number and take mail only when the main one is unavailable.
A domain can have several MX records at once, which gives it redundancy. Email is usually run by a separate provider (Google Workspace, Microsoft 365, a mail host), so MX often points somewhere other than the server that hosts the site.
MX only covers receiving mail. Whether your outgoing messages stay out of spam depends on separate TXT records: SPF, DKIM and DMARC. A working MX therefore does not guarantee that your mail gets delivered.
Example
example.com. 3600 IN MX 10 aspmx.l.google.com.
Common mistakes
- Thinking a higher priority number means a more important server. The lowest number wins.
- Putting an IP address in MX instead of a hostname. MX must point to a host that has its own A record.
- Confusing MX with the site's A record and expecting mail to go where the site is hosted.
- Ignoring SPF, DKIM and DMARC, then wondering why mail with a valid MX lands in spam.