Visual RFC.
ALL RFCs / RFC 5321
Read the RFC ↗
RFC 5321 / MAIL FOUNDATIONS

DNS & the next hop

02

A recipient domain leads to DNS mail exchangers, then usable host addresses for a delivery attempt.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

DIAGRAM§ 5.1 ↗
RFC 5321 · § 5.1EXAMPLE
4 / 4
DNS & the next hopA DNS lookup returns ranked MX records and address data; the sender tries the preferred exchanger and then an alternative when needed.DNS chooses the next mail hopIllustrative recipient: user@example.netSending MTArecipient domainDNSMX + addresseslookupRanked MX results10 mx-a.example.net20 mx-b.example.netPreferred MXAlternate MXfallbackTry appropriate alternatives after failure
04
Handle an unreachable candidate.

Appropriate alternatives are tried before the sender treats the delivery attempt as exhausted.

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
KEY POINT

Resolve mail routing before opening the next connection.

  • MX preference values rank mail exchangers; lower values are preferred.
  • With no MX records, the domain can act as an implicit MX under §5.1 rules.
  • Try appropriate alternative addresses and hosts; a temporary DNS failure is different from an authoritative nonexistence result.
DETAILS

MX targets need usable address records. The relay must also avoid routing loops. Later null-MX conventions are defined separately, rather than being a feature invented by RFC 5321.

Read the RFC section ↗

Diagrams simplify the RFC. Read the linked sections for complete requirements.

Privacy
All chapters in this RFC
  1. Envelope vs message
  2. DNS & the next hop
  3. Greeting & extensions
  4. MAIL, RCPT, DATA
  5. Lines & dot transparency
  6. Replies & later changes
  7. Relays, aliases & traces
  8. Queues, retries & timeouts
  9. Acceptance & failure reports
  10. Security & scope
RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗