isitdns? wiki/Records/MX: mail exchange
Records

MX: mail exchange

MX records tell a sending SMTP server where to deliver mail for a domain. Each MX carries a numeric preference; the lowest number is tried first.

run it right here; the dig tool has every option

open in the dig tool →

typeMXwire type15rfc1035, 5321common ttl300

In one line:

example.com.    MX    10    mx1.mailprovider.com.
└── mail for ┘ └type┘ └#┘   └── goes to this server (lowest # first)

What it holds#

A preference number (16 bits on the wire) and a hostname the sender resolves next for A/AAAA. The hostname cannot be a CNAME (RFC 2181 §10.3). Lowest preference is tried first; equal preferences tie-break at the sender's discretion (RFC 5321 §5.1).

mx.example.isitdns.net.   MX  10  mx.example.com.

When to use it#

  • For any domain that receives mail. The apex is the typical place, but you can have MX at any name (for departmental routing, e.g., sales.example.com).
  • For backup MX in front of an on-prem mail server: a higher-preference MX at a hosted service that queues during outages.

When not to use it#

  • For a domain that doesn't send or receive mail: publish a null MX instead (see Gotchas). Easier than fighting senders that keep retrying for days.
  • For load balancing: preference is a discrete ranking, not a weighted load distribution. Use equal-preference for round-robin instead.

dig example#

Asks which servers take mail for mx.example.isitdns.net.

 dig @1.1.1.1 mx.example.isitdns.net MX
; <<>> DiG 9.20.11-0ubuntu0.2-Ubuntu <<>> @1.1.1.1 mx.example.isitdns.net MX
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47825
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;mx.example.isitdns.net. IN MX
;; ANSWER SECTION:
mx.example.isitdns.net. 300 IN MX 10 mx.example.com.
;; Query time: 36 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Mon Sep 14 13:45:34 CDT 2026
;; MSG SIZE rcvd: 81

GO NOERROR, one MX record, preference 10

NO GO NOERROR with no answer, which means senders fall back to this name's A/AAAA

run this query in the dig tool →

what each part of this output means →

RFC: RFC 1035 defines the MX record; RFC 5321 §5.1 defines how a sender uses it.

Gotchas#

  • The MX target must resolve to an A or AAAA record, not a CNAME (RFC 2181 §10.3) or a bare IP.
  • No MX does not mean no mail. With no MX at all, senders fall back to an implicit MX: the domain's own A/AAAA record, treated as a mail server with preference 0 (RFC 5321 §5.1).
  • Null MX for non-mail domains: RFC 7505 says a domain that never receives mail should publish a single MX record with preference 0 and a target of . (literal dot):
example.com.   MX   0   .

Senders interpret this as "do not deliver here" and bounce immediately rather than retrying for days.

  • SPF/DKIM/DMARC are separate: having an MX does not authorize anyone to send on your behalf. See email-records.

See also#