“警告:在openVZ / Debian容器中,主机名localhost不parsing为地址:: 1:没有与主机名关联的地址”

我正在从postfix的mail.log中获取mesages regulary。 在特殊的,但不仅在邮件发送收到的邮递员。

警告:主机名localhost不parsing为地址:: 1:没有与主机名关联的地址

:: 1以及127.0.0.1被定义为/ etc / hosts中的localhost – 由openVZ提供。

其实这里面configuration了/ etc / hosts(我删除了特殊的域名和IP地址):

fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 2a01::<some IPv6> host.example.org host example.org 127.0.0.1 localhost.localdomain localhost # Auto-generated hostname. Please do not remove this comment. xxx.xxx.xxx.xxx host.example.org host example.org ::1 localhost ip6-localhost ip6-loopback 

这似乎工作:

 $ host localhost localhost has address 127.0.0.1 localhost has IPv6 address ::1 

在这个盒子里,布雷也在跑步。

它似乎增加

 multi on 

到/etc/host.conf hase解决了这个问题。

基于我在互联网上find的,这是允许有一个主机名(在这种情况下,本地主机)适合IPv4地址和IPv6多个IP。

另外: Postfix指出添加

 import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C RESOLV_MULTI=on 

到你的/etc/postfix/main.cf也解决了这个问题。 它只为我工作。

除了给出的frlan答案之外,在Ubuntu 12.04系统上,/etc/host.conf具有“multi on”,etc / hosts文件正确标识ipV4和ipV6本地主机地址。

问题仍然在发生,在我的情况下是在Debian日志中描述的后缀init脚本中:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=723915

因此,将(简单)补丁应用于/etc/init.d/postfix意味着Postfix使用了/etc/host.conf,问题消失了。

Postfix v 2.9.6

更改你的/ etc / hosts:

 ::1 localhost 

 ::1 localhost6.localdomain localhost6 ip6-localhost ip6-loopback 

如果不行,请发布你的/ etc / hosts。