en

MX (Mail Exchange) is a type of DNS record that tells which mail servers accept email for a domain. It is the MX record that lets a sending server know where to deliver mail addressed to something like user@example.com.

How MX and priority work

Each MX record holds a numeric priority and a mail server name, for example "10 mail.example.com". The lower the number, the higher the priority: a sending server first tries the record with the smallest value and only falls back to the others if the primary server is unreachable. The name from the MX is then resolved through an A record into a concrete IP address where the SMTP connection is established.

Setup and related records

A few details are worth keeping in mind when working with MX:

  • Multiple servers — you can define several MX records with different priorities to make delivery redundant.
  • Name, not IP — an MX value must point to a domain that has an A record, never directly to an IP address.
  • Caching — MX changes propagate with a delay bounded by the record's TTL.

A single MX record is not enough for reliable email: alongside it, SPF, DKIM and DMARC are configured in TXT records to confirm the sender's authenticity and reduce the chance of messages landing in spam.

DNS MX record — a domain's mail servers
Learn more

Tag cloud