[ DNS & domains ]

DNS MX records: mail routing, priorities and dependencies

Trace receiving mail routes through MX priorities and address dependencies without treating them as sender authorization.

By the EmailAuth research team

[ Key points ]

  • Lower MX preference is favored; equal values do not guarantee a split.
  • Absent MX, broken explicit routes and null MX have different meanings.
  • DNS routing and SMTP acceptance are not final mailbox delivery.
On this page

MX records tell SMTP clients where a domain receives mail. They do not, by themselves, authorize a service to send as that domain. A reliable receiving setup requires usable exchange hostnames, reachable SMTP endpoints and a plan for temporary failure, not merely a green MX lookup.

Interpret preference correctly

References: RFC 5321 §5.1, RFC 2181 §10.3.

Each MX record contains a numeric preference and an exchange hostname. Lower preference numbers are tried before higher numbers. When there is no clear reason to favor one equal-preference destination, RFC 5321 requires randomizing their order to spread load. Their order in a DNS answer is not a stable primary-server designation. All advertised routes should be intended and operational.

An exchange hostname must have usable A or AAAA records and must not be a CNAME. Do not put an IP literal in the MX exchange field. Resolve each exchange separately, then test the advertised SMTP service. An address answer alone cannot show whether the endpoint accepts mail for the recipient domain.

Distinguish absent, unusable and null MX

References: RFC 5321 §5.1, RFC 7505 §3.

SMTP has an implicit-MX rule when a successful lookup returns no MX records: it treats the domain itself as the target and looks for its address records. This is not permission to ignore broken explicit MX records and use the domain's website address instead. A temporary DNS error also differs from a definitive absence and normally leads to queueing and retry.

A null MX is an explicit statement that the domain accepts no mail: a single MX with preference zero and the root label as exchange, commonly displayed as 0 .. RFC 7505 says not to publish other MX records alongside it. No MX and null MX are therefore different configurations.

Work through routing fixtures

Synthetic fixture A has example.com. MX 10 mx1.example.com. and example.com. MX 20 mx2.example.com.. The first host has A 192.0.2.10; the second has A 192.0.2.20. Expected preference order is mx1 before mx2. A failed connection to mx1 can cause another permitted delivery attempt; it does not prove mx2 accepted the message.

Fixture B removes both MX records but leaves example.com. A 192.0.2.30. Under the implicit-MX rule, that address becomes the potential SMTP destination. Fixture C instead publishes only example.com. MX 0 .; expected interpretation is that the domain accepts no mail. Fixture D retains A's MX records but removes both exchanges' addresses. Expected outcome is unusable explicit routes, not fallback to the apex A record.

Reproduce the DNS part in a lab by querying MX for each isolated fixture and A/AAAA for every returned exchange. Record the selected order and classification. Use a controlled SMTP server to test retry and acceptance if needed. The documentation addresses and described outcomes are illustrative, not production measurements.

Verify the business route

References: RFC 7208 §5.4, RFC 5321 §4.2.5.

Keep inbound routing separate from SPF policy. An SPF mx mechanism can explicitly make MX-associated addresses relevant to an SPF evaluation, but publishing MX alone does not create that authorization. Changing inbound providers may therefore also affect an existing SPF policy that uses mx and deserves a separate review.

During a migration, verify recipient provisioning, SMTP responses and transport security on all active exchanges before removing the old route. A backup exchange can accept spam or reject legitimate recipients if configured differently. Record who owns each endpoint and what evidence closes the change; do not equate SMTP acceptance with inbox placement or a human reading the message.

Captured isolated routing run

The retained historical capture, inspected for this review but not rerun, records that on 7 November 2026 at 20:34:42 UTC an executed loopback fixture returned the MX set 10 mx1.example.com. and 20 mx2.example.com. from 127.0.0.1 port 42125. A Python 3.12.14 client using dnspython 2.9.2 sorted these preferences. The explicit lab endpoint map sent mx1 to 127.0.0.1 port 45271 and mx2 to port 37481; this port map replaces public port-25 routing only within the fixture.

With both listeners running, mx1 returned 220, accepted EHLO with 250, accepted MAIL FROM and RCPT TO with 250, entered DATA with 354 and returned 250 synthetic message accepted; discarded locally. After closing only the primary listener, the next run recorded ConnectionRefusedError for mx1 and the same acceptance sequence at mx2. No external mail, real recipient or mailbox delivery was involved.

To reproduce, start two loopback SMTP fixtures, query the lab MX responder, map its exchange names to the listeners and send a harmless synthetic message with Python smtplib. Repeat after closing the primary. Retain the wire response, endpoint map, client/server transcript, timestamps and tool versions. The captured fixture uses a deliberately small SMTP server and demonstrates preference-driven retry only; it is not a conformance test of a production MTA or evidence of production failover.

Keep the evidence scope explicit

The archived transcript confirms only the loopback fixture behavior described above, including its custom port mapping and local discard. The source capture and harness are retained unchanged; this review did not repeat SMTP traffic or infer production failover from the historical test.

[ Takeaway ]

Lower MX preference is favored; equal values do not guarantee a split. Absent MX, broken explicit routes and null MX have different meanings. DNS routing and SMTP acceptance are not final mailbox delivery.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Follow MX through to SMTP

Preference values and address resolution are only the first stages of an inbound test.

Next steps

  1. Resolve every exchange to A and AAAA.
  2. Test explicit, absent and null MX separately.
  3. Review SPF mx dependencies before changes.

CISO / SecOps

Keep alternate exchanges in scope

Every advertised route can become an active processing path during a failure.

Next steps

  1. Review all advertised SMTP endpoints.
  2. Require consistent recipient and abuse controls.
  3. Separate acceptance from delivery claims.

Founder / Non-technical

Protect every receiving route

A backup exchange is part of the customer communication path, not spare configuration to ignore.

Next steps

  1. Identify the owner of every inbound route.
  2. Require mailbox migration tests.
  3. Keep backup-route behavior in scope.

[ FAQs ]

Frequently asked questions

Does a larger MX preference mean higher priority?

No. Lower numbers are preferred.

RFC 5321 §5.1

Do equal numbers guarantee an exact traffic split?

No. They do not specify a guaranteed percentage allocation.

RFC 5321 §5.1

Can an exchange field contain an IP address?

Use a hostname with address records, not an IP literal.

RFC 2181 §10.3 RFC 5321 §5.1

Can the exchange hostname be an alias?

No. The cited rules require address records rather than a CNAME target.

RFC 2181 §10.3

Does no MX mean no mail?

Not necessarily. SMTP may use an implicit MX pointing to the domain itself.

RFC 5321 §5.1

What does 0 . mean?

It is null MX when published as the domain’s single MX record, declaring no mail acceptance.

RFC 7505 §3

Does broken explicit MX fall back to the website A record?

No. The implicit-MX fallback applies when MX records are absent, not unusable.

RFC 5321 §5.1

Does MX authorize outbound mail?

Not by itself. An explicit SPF mechanism can reference it, but receiving routes and sender authorization are distinct.

RFC 7208 §5.4

[ Sources ]

Sources

  1. RFC 7208

    Sections §5.4

  2. RFC 5321

    Sections §4.2.5 · §5.1

  3. RFC 7505

    Sections §3

  4. RFC 2181

    Sections §10.3

[ Glossary ]

Glossary

MX preference
A number used to order candidate exchanges, with smaller values preferred.

RFC 5321 §5.1

Null MX
A sole MX record with preference0 and exchange dot declaring no mail acceptance.

RFC 7505 §3

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base