When a recipient domain publishes no MX record, where does an RFC 5321 sending MTA deliver, and when must it report an error instead?
answer
- what an empty MX answer means
- the domain stands in for itself
- preference 0, then A or AAAA
- NXDOMAIN versus a temporary DNS failure
- any MX present: address records ignored
basics
~20 sUnder RFC 5321 section 5.1, an empty MX answer makes the domain its own implicit MX at preference 0, so the sender uses its A or AAAA addresses; a non-existent domain is an error and a temporary DNS failure is queued.
solid answer
~50 sRFC 5321 §5.1 has the sender look up MX first; if the name is a `CNAME`, the target is processed as if it were the original name. Then it depends on the answer. A non-existent domain MUST be reported as an error, and a temporary DNS error MUST leave the message queued for a later retry. An empty MX list means the domain is treated as an **implicit MX** with preference 0 pointing at itself, so the sender connects to its `A` or `AAAA` addresses. Once any MX record exists, the domain's own address records are never used except through those MX records, and if none of the exchanges is usable the sender reports an error. The trap in practice is a domain with only a website `A` record: every message is attempted against the web host, and with no listener on port 25 senders keep retrying for days.
go deeper
Remember the rule: no MX record means senders deliver to the domain's own A or AAAA address, at preference 0. Once any MX exists, the domain's own address is never used for mail.
Walk through RFC 5321 section 5.1 answer by answer: CNAME followed, NXDOMAIN an error, a temporary failure queued, an empty list giving the implicit MX, unusable MX records an error.
Diagnose from the DNS answer. Mail stuck for days at a website-only domain is the implicit MX hitting a host with no listener. An instant bounce means NXDOMAIN or MX hosts with no addresses.
Every domain your organisation owns needs a deliberate mail answer. Either real MX records or a null MX, so that no web host quietly becomes the implicit MX for mistyped addresses.
## The lookup a sender performs When a sending **MTA** (mail transfer agent) has a recipient such as `[email protected]`, it must find a host that accepts mail for `example.org`. RFC 5321 §5.1, the current SMTP specification (October 2008), sets the order. It starts with an `MX` query for the recipient domain and acts on what DNS returns: 1. If the name is a `CNAME`, the target name is processed **as if it were the initial name**, and the MX lookup continues there. 2. If DNS says the domain does not exist (an NXDOMAIN answer), the sender **MUST report an error**. There is no retry. 3. If DNS returns a **temporary error**, such as a timeout or a server failure, the message **MUST be queued and retried later**. A transient resolver problem must not bounce mail. 4. If the query succeeds but returns **no MX records**, the domain is treated as having an **implicit MX** with preference 0 that points at the domain itself, and the sender looks up its `A` and `AAAA` records. 5. If MX records exist but none is usable, or the implicit MX has no usable address, the sender **MUST report an error**. How the sender orders several exchanges and what an MX record must point at are covered with DNS record types. This answer is about the cases on either side of that list: no records at all, and records that exist but fail. ## One answer, one action | DNS answer to the MX query | What an RFC 5321 sender does | |---|---| | One or more usable MX records | Delivers to those exchanges only | | Name exists, empty MX list | Implicit MX: delivers to the domain's own `A`/`AAAA` addresses | | `CNAME` at the queried name | Restarts the lookup at the target name | | Non-existent domain | Reports an error at once | | Temporary DNS failure | Queues the message and retries | | MX records present, none usable | Reports an error | ## Why "MX present" switches the fallback off The sentence that does the most work in §5.1 is easy to skim past: if one or more MX records exist, SMTP systems **MUST NOT** use any address records for that name unless they were reached through the MX records. The implicit MX rule applies **only** when no MX records are present. Two consequences follow for anyone running a domain: - **An MX outage is not rescued by the apex address.** If every exchange is unreachable, the sender does not try the domain's web server. Unreachable hosts are a transient condition, so the message stays queued and is retried until it is delivered or the sender's give-up time runs out. - **Publishing any MX record is a decision.** It replaces the implicit route completely. This is also what lets a null MX (RFC 7505) work: a domain with a null MX still has an MX record, so its website address is never tried for mail. ## What this looks like on a domain you run The common case is a domain that hosts a website and was never meant to take mail. It has an apex `A` record and no MX. To a sender that is an implicit MX, so every message to that domain, including mistyped addresses, goes to the web host on port 25. If nothing listens there, each attempt fails as a connection failure, which counts as temporary. RFC 7505 describes the result: delivery is attempted repeatedly for a long period, typically a week, before the sending MTA gives up. The sender learns of the problem late, and both sides waste resources. The two honest fixes are: - **publish real MX records** if the domain should receive mail, or - **publish a null MX** if it should receive none, so senders fail the message on the first attempt. The reference MTA shows how an implementation settles an edge case the RFC leaves to it. Postfix's `smtp_defer_if_no_mx_address_found` (default `no`) returns mail as undeliverable when no MX host resolves to an address. Its documentation notes that older Postfix versions kept retrying until someone fixed the MX record or the mail grew too old. ## Reading the outcome When a user asks why mail to a partner domain bounced or is stuck, the MX answer usually explains it: - **Bounced at once**: the domain does not exist, or it has MX records and none of them resolves to an address. - **Stuck in the queue**: the resolver returned temporary errors, or the exchanges (or the implicit MX's address) refuse connections. - **Delivered somewhere unexpected**: the domain has no MX, so mail went to whatever its `A` or `AAAA` record points at. Retry intervals and give-up times are covered with submission and bounces. This answer is about which host the sender chooses and when it must give up looking.
- Why can a domain with only a website A record leave senders retrying for days?With no MX, the apex `A` record is the implicit MX, so senders connect to the web host on port 25. If nothing listens, every attempt is a connection failure, which is transient, so the message stays queued until the sender's give-up time. RFC 7505 says this is typically a week. Publishing a null MX, or real MX records, ends it on the first attempt.
- Does the implicit MX rule ever apply to the host an MX record names?No. The implicit MX applies only to a recipient domain with no MX records at all. The exchange an MX record names must resolve to at least one address record. If the domain has MX records and none of them is usable, RFC 5321 §5.1 says the sender reports an error. It does not fall back to the domain's own address.
- With no MX record, mail for a domain simply cannot be delivered.
- If every MX host is down, senders fall back to the domain's A record.
- A temporary DNS failure on the MX query makes the message bounce at once.
- The implicit MX ranks below real MX records as a last resort.
- A CNAME at the recipient domain makes the MX lookup fail.