MX What is an MX Record?

MX records tell mail servers where to deliver email for your domain. Learn the priority system and how to configure Google Workspace or Microsoft 365.

What is an MX record?

An MX (Mail Exchange) record is a DNS resource record that specifies which mail server is responsible for accepting incoming email for a domain. When someone sends an email to you@example.com, their mail server queries DNS for the MX records of example.com to find out where to deliver the message.

Without a valid MX record, email delivery to your domain will fail.

Anatomy of an MX record

example.com.  3600  IN  MX  10  mail.example.com.
FieldValueDescription
Nameexample.com.The domain receiving email. Trailing dot denotes root.
TTL3600Time-to-live in seconds (how long resolvers cache this record).
ClassINInternet class — always IN for standard DNS records.
TypeMXRecord type.
Priority10Lower number = higher priority. Used for failover ordering.
Mail servermail.example.com.Fully-qualified hostname of the mail server. Must resolve to an IP via an A or AAAA record.

Priority and failover

A domain can have multiple MX records with different priorities. Mail senders try the lowest-numbered (highest-priority) server first. If it's unreachable, they try the next highest, and so on.

example.com.  IN  MX  10  mail1.example.com.
example.com.  IN  MX  20  mail2.example.com.

Here mail1 is tried first. If it's down, delivery falls over to mail2. Records with equal priority are tried in random order (round-robin).

Common configurations

ProviderMX recordPriority
Google WorkspaceASPMX.L.GOOGLE.COM.1
Google Workspace (alt)ALT1.ASPMX.L.GOOGLE.COM.5
Microsoft 365domain-com.mail.protection.outlook.com.0
Proton Mailmail.protonmail.ch.10

Common mistakes

  • Pointing to an IP address — MX records must point to a hostname, not an IP. The hostname is then resolved separately via A/AAAA records.
  • Forgetting the trailing dot — In zone file notation, a hostname without a trailing dot is treated as relative to the zone. mail becomes mail.example.com. — which may or may not be what you intend.
  • Confusing priority direction — Lower number means higher priority. 10 is preferred over 20.
  • Missing A record for the mail server — If your MX points to mail.example.com. but that hostname has no A record, mail delivery will fail.

Frequently asked questions

What does MX stand for?

MX stands for Mail Exchange. The record identifies which mail server handles email for a domain.

Can I have multiple MX records?

Yes. Multiple MX records with different priorities provide failover. If the highest-priority server is unavailable, senders try the next one. Records with equal priority are tried randomly.

What happens if I have no MX record?

Mail servers will try to deliver email directly to the A record for the domain as a fallback, but this often fails. Most email will bounce.

Can an MX record point to a CNAME?

Technically possible but explicitly prohibited by RFC 2181. Some mail servers will refuse to deliver to a CNAME target. Always point MX records to A or AAAA records directly.