大网数据广告活动
服务器运维问答

Postfix warning when sending mail: hostname <FQDN> does not resolve to address xxx.xxx.xxx.xxx

· 52CE 我爱测

Every time I send an email, I get this line in /var/log/mail.warn: postfix/submission/smtpd[xxxxx]: warning: hostname <FQDN> does not resolve to address xxx.xxx.xxx.xxx I've obviously already Google'd the issue; my /etc/host.conf…

问题原文

原帖链接 · hcac · CC BY-SA 3.0

Every time I send an email, I get this line in /var/log/mail.warn:

postfix/submission/smtpd[xxxxx]: warning: hostname <FQDN> does not resolve to address xxx.xxx.xxx.xxx

I've obviously already Google'd the issue; my /etc/host.conf has "multi=on" as the only entry, I've tried to add the following two lines to /etc/postfix/main.cf:

smtp_host_lookup = native #(also tried "dns", for that matter)
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C RESOLV_MULTI=on

Nothing helped. I suspect the issue lies in the nature of the server's config; it's a Hetzner server which has a different internal IP, see here: https://wiki.hetzner.de/index.php/VServer/en#Why_does_my_VM_have_a_different_IP_from_the_one_shown_in_the_Robot.3F

But I can't figure out how to fix that. I've used this guide for mailserver setup, so most config files are 100% as in here:

https://thomas-leister.de/sicherer-mailserver-dovecot-postfix-virtuellen-benutzern-mysql-ubuntu-server-xenial/

For the sake of completeness, here's /etc/hosts:

# IPv4
127.0.0.1 localhost.localdomain localhost
# (old) 172.xx.xx.xx  Debian-85-jessie-64-LAMP
172.xx.xx.xx mysrv.mydomain.tld mysrv
#
# IPv6
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
xxx:xxx:xxx:xxx::2  Debian-85-jessie-64-LAMP

已采纳解答

原帖链接 · hcac · CC BY-SA 3.0

Just to answer my own question (not sure if that's violating any rules or not):

I've replaced the internal Hetzner IP with the public one in /etc/hosts and everything works fine now, the warning is gone. I have no idea why the public one isn't entered there by default, and if there's any drawback to changing that.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。