Postfix (Email) - Resolve "hostname does not resolve to address"
by
Jeremy Canfield |
Updated: February 21 2023
| Postfix (Email) articles
Let's say something like this appears in /var/log/maillog.
Feb 21 07:53:50 smtp postfix/smtpd[13676]: warning: hostname smtp.example.com does not resolve to address 107.20.59.106: Name or service not known
Of course, this will happen if myhostname in /etc/postfix/main.cf is set to the hostname in the warning.
myhostname = smtp.example.com
I once had this issue where a forward DNS lookup returned the expected hostname and IP address.
~]$ nslookup mail.example.com
Server: 172.31.0.2
Address: 172.31.0.2#53
Non-authoritative answer:
Name: mail.example.com
Address: 107.22.51.98
But a reverse DNS lookup returned the hostname and IP address in the maillog warning.
~]$ nslookup 107.20.59.106
106.59.20.107.in-addr.arpa name = smtp.example.com.
In my example, my Postfix server was running on Amazon Web Services (AWS) so I just had to update the Elastic IP (static IP address) to point to the correct reverse DNS hostname.
Did you find this article helpful?
If so, consider buying me a coffee over at