I'm getting the mesage regulary inside mail.log from postfix. In special, but not only, at mails send received mailman.

warning: hostname localhost does not resolve to address ::1: No address associated with hostname

::1 as well as are defined as localhost inside /etc/hosts -- as provided by openVZ.

Actually inside /etc/hosts these is configured (I removed special domains and IP for reasons):

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 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

And this seems to work:

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

On this box bley is also running.


4 Answers 4


It seems adding

multi on

to /etc/host.conf hase solved the issue.

Based on what I've found on the internet, this is allowing to have multiple IP for one host name (in this case localhost) which fit for IPv4 address and IPv6.

  • It's bizarre that this is off by default. There are no sites with large hosts files anymore. Not for 25 years or so... Jul 25, 2014 at 21:59
  • Well... it really happened on Debian (old)Stable -- not sure whether it was really an upstream issue or something I messed up.
    – frlan
    Aug 5, 2014 at 9:20

In addition: Postfix states that adding


to your /etc/postfix/main.cf solves this too. It worked for me only this way.


In addition to the frlan answer given, on a Ubuntu 12.04 system the /etc/host.conf has "multi on" and the etc/hosts file correctly identifies both ipV4 and ipV6 localhost address.

The problem was still happening, and in my case was in the postfix init script as outlined in this Debian log:


So applying the (simple) patch to /etc/init.d/postfix meant that Postfix used the /etc/host.conf and the problem disappeared.

Postfix v 2.9.6


Change in your /etc/hosts:

::1 localhost 


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

If don't work, post your /etc/hosts, please.

  • This is the way to cause this problem, not to fix it. Apr 4, 2014 at 14:35
  • Sorry I got wrong... I'm from Brasil and my english is not good.
    – PoLIVoX
    Apr 4, 2014 at 18:49
  • Also the file is generated by openvz and overwritten on boot time
    – frlan
    Jul 25, 2014 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .