SecDNS

MX record

An MX record points to the mail server that receives SMTP email for a domain, with a priority value controlling failover order, defined by RFC 1035.

MX record

An MX (Mail Exchanger) record specifies the host that receives email for a domain, along with a 16-bit priority value used by senders to choose between multiple mail servers.

In plain English

If you want email at you@example.com to go anywhere, you need an MX record on example.com pointing at a mail server. Sending servers read that MX, connect over SMTP, and deliver the message.

How it works

MX records are defined in RFC 1035 §3.3.9 with type code 15. The rdata contains a 16-bit preference (priority) and the canonical hostname of the receiving mail server. Senders sort the MX set ascending by preference and connect to each in turn until one accepts; equal-preference entries are tried in random order for load balancing. The target of an MX must be an A or AAAA record — RFC 5321 §5.1 explicitly forbids pointing an MX at a CNAME. A domain with no MX falls back to its A/AAAA records (the "implicit MX" rule) but this is fragile and not recommended. MX targets are commonly published with longer TTLs than web records because email is more tolerant of delay. DNSSEC signing prevents MX hijacking, and DANE TLSA records (RFC 7672) can additionally pin SMTP TLS certificates.

  • DNS — base protocol
  • A record — MX targets resolve to A/AAAA
  • AAAA record — IPv6 mail servers
  • SPF — authorises which servers may send mail
  • DKIM — signs outbound mail
  • DMARC — ties SPF and DKIM together
  • CNAME — forbidden as an MX target

SecDNS perspective

SecDNS authoritative hosting publishes MX records with the same anycast resilience as the rest of your zone, and our editor warns you if an MX target is a CNAME or lacks an underlying A/AAAA.

Frequently asked questions

What does MX priority mean?

Lower priority wins. Senders try the lowest-priority MX first, then fall back to higher numbers. Two MX records with the same priority are tried in random order.

Can an MX record point to a CNAME?

No. RFC 5321 §5.1 explicitly forbids pointing an MX at a CNAME. The MX target must have its own A or AAAA record.