Initial impact: intermittent bounces nobody can reproduce
Investigation: querying MX and following the chain with dig
BASH
dig MX example.com +shortTEXT
10 mail.example.com.mail.example.com. The problem only appears when you query the target hostname's record type:
BASH
dig A mail.example.com +shortTEXT
mail.example.com. 300 IN CNAME loadbalancer.hostingprovider.net.
loadbalancer.hostingprovider.net. 60 IN A 203.0.113.50mail.example.com is not an A record. It is a CNAME that points to another hostname, which then resolves to an IP. That extra indirection is what breaks things.
For a more detailed view showing the full answer section and authority records, drop the +short flag:
BASH
dig A mail.example.comIN CNAME before the IN A line, the MX target is aliased.
The critical discovery: why this is an RFC violation
Why this setup happens in the first place
- A hosting migration where someone pointed
mail.example.comas a CNAME to the new provider's hostname, the same way they pointedwww. The www CNAME works fine for HTTP. The mail CNAME silently breaks RFC compliance. - A load balancer or CDN setup where the provider instructs users to create CNAME records for all subdomains. The instructions do not distinguish between web-serving subdomains and mail-serving ones.
- DNS zone templates that default to CNAME for everything except the apex domain.
Temporary mitigation
The architectural fix
TEXT
example.com. IN MX 10 mail.example.com.
mail.example.com. IN CNAME loadbalancer.hostingprovider.net.TEXT
example.com. IN MX 10 mail.example.com.
mail.example.com. IN A 203.0.113.50TEXT
mail.example.com. IN AAAA 2001:db8::50BASH
dig MX example.com +short
dig A mail.example.com +shortdig A mail.example.com (without +short) and confirm the ANSWER SECTION contains only an A record, no CNAME.
Checking for this problem across all your domains
BASH
for mx in (dig MX example.com +short | awk '{print2}'); do echo "--- mx ---"; dig A "mx" +short; donemail.example.com DNS configuration causes certificate issuance failures. And if you suspect a broken CNAME target is causing resolution failures beyond just mail, testing whether a broken CNAME target causes SERVFAIL walks through that diagnostic.
Takeaway
dig A against the MX target hostname. If you see a CNAME in the answer, that is your problem. Replace it with a direct A (or AAAA) record. The RFC violation is clear, the fix is a single DNS record change, and the result is mail that stops failing on strict MTAs.