What the message looks like
warning: hostname mail.example.net does not resolve to address 203.0.113.25: Name or service not knownCommon causes
- The sender's PTR points to a name without a matching A or AAAA record.
- Typical for spam bots and residential lines – then the warning is expected.
- Your own server: PTR set at the hoster, but the A record is missing or points elsewhere.
- IPv6 connection while only an IPv4 reverse entry exists.
- The local resolver returns stale answers or none at all.
Check
- Look up the PTR of the connecting IP
dig -x 203.0.113.25 +short - Check that the name points back to the same IP
dig +short A mail.example.net; dig +short AAAA mail.example.net - Count the most frequent IPs in the log
grep 'does not resolve to address' /var/log/mail.log | awk '{print $NF}' | sort | uniq -c | sort -rn | head - Check whether strict hostname checks are enabled
postconf smtpd_client_restrictions smtpd_recipient_restrictions | grep -o 'reject_unknown[a-z_]*'
Fix
- If it concerns foreign IPs, the warning is normal and can be ignored.
- If it is your own server: set the PTR at your provider and create an A or AAAA record with exactly that IP.
- Prefer
reject_unknown_reverse_client_hostnameoverreject_unknown_client_hostname– the strict one also hits legitimate servers. - For IPv6 sending set a PTR for the IPv6 address, or send over IPv4 only (
smtp_address_preference = ipv4).
FAQ
Is mail rejected because of this warning?
No, the warning alone rejects nothing. Mail is only rejected if you set reject_unknown_client_hostname – then with 450 4.7.25.
Is this a problem with Gmail or Microsoft?
For your own outgoing mail, yes: large providers expect matching forward and reverse DNS and otherwise file the mail as spam or reject it.