MX records explained: how email finds your domain

By the LeadsPaw team · Last updated

SPF, DKIM and DMARC authenticate the mail your domain sends. The other half of the system is the MX record: the DNS entry that tells sending servers where to deliver mail addressed to your domain. RFC 5321 (section 5.1) defines one fallback - with no MX records, a sender treats the domain's address record as an implicit MX - but a domain with neither MX records nor a usable address record leaves replies to your campaigns with nowhere to land. The MX definition itself is short and lives in RFC 1035, the DNS specification.

What an MX record contains

Per RFC 1035 (section 3.3.9), an MX record has exactly two parts:

  • EXCHANGE - a domain name specifying a host willing to act as a mail exchange for the owner name. In plain terms: the server that accepts this domain's email.
  • PREFERENCE - a 16-bit integer ranking this record against the other MX records at the same owner. Lower values are preferred - a sending server tries the lowest-preference host first, falling back to higher numbers if it cannot be reached.

That second field is why a domain can list a primary mail server and backups: the numbers encode the order the world should try them in.

Inbound, not outbound

The cleanest way to place MX in the authentication cluster: it points the other way. SPF, DKIM and DMARC are checked by receiving servers against the mail your domain sends. MX works the other way - it is the public signpost for mail coming to you, including every reply a prospect sends back to your cold email.

And one port fact ties it to the rest of the stack: per RFC 8314, the MX infrastructure has no way to specify a port, so delivery between servers always uses port 25 - which is why 25 is the relay port and 465/587 are for submission, as the SMTP ports guide explains.

What this means for a cold email domain

Two practical checks follow from the definitions. First, your sending domain must actually have MX records pointing at a working mail host - replies go wherever EXCHANGE says. Per RFC 5321 (section 5.1), a domain with no MX records gets one fallback: senders treat its address record as an implicit MX, and only when that is unusable too is delivery an error. Second, MX says nothing about sending authority: publishing MX records does not authenticate your outbound mail, and authenticating outbound mail does not route inbound replies. Set up both sides - the setup guide covers the authentication records - and test end to end by sending yourself a message and replying to it.

Frequently asked questions

What does an MX record do?

It tells the world which host accepts email for your domain. Per RFC 1035, an MX record's EXCHANGE field names a host willing to act as a mail exchange for the domain - when someone sends you email, their server looks up your MX records to learn where to deliver it.

What does the MX preference number mean?

It ranks multiple mail servers. RFC 1035 defines PREFERENCE as a 16-bit integer specifying the preference given to that record among others at the same owner - and lower values are preferred. A sender's server tries the lowest-numbered MX host first.

Is MX the same as SPF, DKIM or DMARC?

No - they work on opposite sides. MX is inbound: where mail addressed to your domain gets delivered. SPF, DKIM and DMARC are about outbound mail: proving the messages your domain sends are really yours. A working email setup needs both sides configured.

Which port does mail delivery to my MX host use?

Always port 25. Per RFC 8314, the MX infrastructure has no way to specify a port, so server-to-server delivery to your MX host always happens on port 25. The submission ports 465 and 587 are for handing your outgoing mail to your provider - a different job entirely.