4

I'm trying to install zimbra on a linux server. I downloaded the Ubuntu 12.04 LTS version of zimbra, unpacked and tried to run install.sh. But after I have approved the license I get this problem.

ERROR: Installation can not proceeed. Please fix your /etc/hosts file to contain:

127.0.0.1 localhost.localdomain localhost

Zimbra install grants mysql permissions only to localhost and
localhost.localdomain users. But Fedora/RH installs leave lines such as these in /etc/hosts:

127.0.0.1 myhost.mydomain.com myhost localhost.localdomain localhost

This causes MySQL to reject users coming from 127.0.0.1 as users from myhost.mydomain.com. You can read more details at:

http://bugs.mysql.com/bug.php?id=11822

The hosts file now looks like this.

127.0.1.1   localhost.localdomain   localhost
127.0.1.1   linux-server-test   localhost
127.0.1.1   mail.mydomain.com   mail

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I Change it to this

127.0.0.1   localhost.localdomain   localhost
127.0.0.1   linux-server-test   localhost
127.0.0.1   mail.mydomain.com   mail

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I then run the script again and this time i get this problem.

ERROR: Installation can not proceeed. Please fix your /etc/hosts file to contain:

ip FQHN HN

Where is the ip address of the host, is the FULLY QUALIFIED host name, and is the (optional) hostname-only portion

I try a last time and remove the lines about localhost and linux-server-test yet the same result. I have config the dns to be able to handle email so that should not be a problem.

dig mydomain.com mx

; <<>> DiG 9.9.2-P1 <<>> mydomain.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15967
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mydomain.com.      IN  MX

;; ANSWER SECTION:
mydomain.com.   600 IN  MX  30 mail.mydomain.com.

;; Query time: 17 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Mon Aug 12 16:08:17 2013
;; MSG SIZE  rcvd: 66

So what I'm i doing wrong? (I Replaced all the domain entries in this post to mydomain.com instead of my real domain)

1
  • 1
    Make sure that the output for command hostname matches the fqdn in /etc/hosts Jun 2, 2015 at 10:45

8 Answers 8

7

Use a dedicated line to define your FQDN.

192.168.10.9     mail.mydomain.com mail

Remove it from the 127.0.0.1 line.

4
  • Did you check the host files i posted, used I hade a dedicated line for the domain. Aug 12, 2013 at 15:00
  • Host files are read top-to-bottom, and I know your mail server's IP address is not 127.0.0.1. Change the 127.0.0.1 on the FQDN line to the server's real IP address.
    – ewwhite
    Aug 12, 2013 at 15:04
  • I tried that both the external ip and the ip inside of the local network got the the same error as i posted. (the second) Aug 12, 2013 at 15:06
  • 1
    No. You didn't :) Sorry.
    – GioMac
    Aug 12, 2013 at 16:08
3

Define the server in /etc/hosts

138.68.159.74 mail.domain.com mail

127.0.0.1 localhost

ensure the hostname is set to mail or whatever

hostname mail
1
  • 1
    ensure the hostname is set to mail or whatever this was the answer for me
    – HadiRj
    Mar 17, 2018 at 12:35
2

In all of your examples you are showing an IP of 127.x.x.x. You need to use a real IP. Here's what my hosts file looks like:

[root@zimbra ~]# cat /etc/hosts
1.2.3.4 zimbra.mydomain.com zimbra
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

1

I've also encountered this issue when installing on Ubuntu 14.04. There is a bug in their detection script for this. The script pulls only the first line that contains:

localhost

or

localhost.localdomain

in any position, like ipv6-localhost. All other lines are ignored. Ubuntu places the IPv6 loopback as the first line, so even if you have the suggested line:

127.0.0.1 localhost.localdomain localhost

The script never detects that you've corrected the problem.

Solution: Make sure you specify the 127.0.0.1 line ABOVE any IPv6 configuration and the script will succeed.

1

I had same problem.

It did not worked, until I set my own hostname to match whatever it is in /etc/hosts. e.g.

138.1.1.1 mail.domain.com mail

127.0.0.1 localhost

and execute:

hostnamectl set-hostname mail.domain.com

This works for CentOS 7.x and Archlinux.

1

I had same problem. enter image description here

I set my own hostname in /etc/hosts. e.g.

192.168.4.10 mail.tslonlinestuff.com mail
127.0.0.1 localhost

and no need to reboot just execute below command:

hostnamectl set-hostname mail.tslonlinestuff.com
0

If you build your Zimbra server in a private range behind some NAT router it could be handy to install a tool like DNSMASQ on that server. That way your hostname and dns resolver are always in sync on that server and Zimbra should be happy whatever NAT, proxy, VPN or other real connection you have to the internet.

  1. Install the dnsmasq package with your prefered package tool.
  2. Edit your /etc/hosts file to include your mailserver and IP address:

    127.0.0.1 localhost

    192.168.x.x mail.mydomain.com mail

  3. Edit your /etc/resolv.conf to use the local dnsmasq server (if needed)

    nameserver 127.0.0.1

    nameserver 8.8.8.8 # Or company DNS server

    search mydomain.com

  4. Configure your dnsmasq configuration: /etc/dnsmasq.conf minimal suggestion:

    domain-needed

    bogus-priv

    local=/mydomain.com/

    expand-hosts

    domain=mydomain.com

    mx-host=mydomain.com,mail.mydomain.com,50

  5. Restart dnsmasq.

One remark when installing Zimbra: Do not install zimbra-dnscache, because you're running your own version now.

-2

Just Reboot Your Server after reconfiguring /etc/hosts file. Ubuntu has to reload Changes

You must log in to answer this question.

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