0

I just installed Zimbra and I think I screwed up my host name trying to get it to install.

I did get Zimbra installed but the certificate is not working. (that's another topic)

Here is my host file:

127.0.0.1       localhost
127.0.1.1       GreenHornet
xxx.xxx.xxx.85    mydomain.co GreenHornet
xxx.xxx.xxx.85    mydomain.co GreenHornet
xxx.xxx.xxx.85    webmail.mydomain.co GreenHornet

# 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

Of course the ip and domain name was changed.

And this is my hostname file:

mydomain.co

I wanted the servername to be GreenHornet but I changed it for the install. Also, I have the ip pointing to the server and that works fine but I wasn't sure if I did the host file correctly.

Is the host file right? Should I change the hostname file back to GreenHornet?

Any help would be greatly appreciated!

  • GreenHornet isn't a FQDN, also, is the xxx ip's your external ip or the ip on the device? – Braiam Sep 20 '13 at 18:13
  • so what does that mean about my host files? The .85 is my external ip. – ErocM Sep 20 '13 at 18:17
1
+50

I think you are mixing up things.

You are mixing domain name and aliases and fqdn.

webmail or GreenHornet are aliases (aka services inside your domain name)

alias + domain name = fqdn

the fqdn is the way to identify your service/server (if your DNS Server has the good settings)

I do not recommend using uppercase, you cannot know if it'll work correctly

To sum up you have this /etc/hosts file :

127.0.0.1       localhost
127.0.1.1       GreenHornet
xxx.xxx.xxx.85    mydomain.co GreenHornet
xxx.xxx.xxx.85    mydomain.co GreenHornet
xxx.xxx.xxx.85    webmail.mydomain.co GreenHornet

# 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

it means that you have 2 possible fqdn : webmail.mydomain.co and mydomain.co (if your DNS settings use a wildcard). Both answer to xxx.xxx.xxx.85 And you have one alias : GreenHornet witch answers for 127.0.1.1 and xxx.xxx.xxx.85

By what you want to accomplish you must correct this file to this form (considering all in lower case) :

127.0.0.1       localhost
127.0.1.1       greenhornet
xxx.xxx.xxx.85    mydomain.co webmail.mydomain.co greenhornet.mydomain.co

# 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

You have another file to see in order to change your server hostname

edit the /etc/hostname and set it up to :

greenhornet.mydomain.co

then reboot your server or execute this command to validate the hostname change :

service hostname start

Restart your apache and it'll be ok then. If not reboot your server.

You talk about a certificate. You must know that you must at least respect the cn that you have set into the certificate for this one to be valid.

You may also need to reconfigure your zimbra for taking in consideration the new hostname.

Best regards.

  • for the hostname, if I don't have greenhornet.mydomain.co pointing to the ip, do I just use mydomain.co instead? – ErocM Sep 22 '13 at 17:10
  • you can do this. However you need to have the same fqdn as you have set to your certificate. plus it'll be good only for mydomain.co and greenhornet.mydomain.co will not work. – Antoine Rodriguez Sep 25 '13 at 6:14
1

Antoine Rodriguez's answer is a good one.

Just add my 2 cents as I have installed / configured Zimbra 8.0.3 for an internal test environment before.

In my case, I just set the hostname (/etc/hostname) the same as FQDN and let the DNS server handle the name resolution.

NOTE: Not sure if you have a DNS server in the network but I strongly recommend setting up one if you want to send/receive emails (you'll need MX records in addition to A/AAAA and CNAME anyway).

/etc/hosts file is the static table lookup for hostnames. Hostname lookup is controlled by /etc/nsswitch.conf file, by default it looks up in the hosts file and then the DNS server.

hosts: files dns

So the hostnames you set in /etc/hosts are only resolvable on the server itself, unless you push the same entries to all client machines (which will connect to the zimbra server).

Off-topic

In addition to changing hosting in /etc/hostname, you can also change the hostname on the fly by directly changing the /proc/sys/kernel/hostname.

For example:

echo greenhornet.mydomain.co > /proc/sys/kernel/hostname
exec -l $SHELL

You'll see the new hostname taking effect in the new subshell. To survive reboots, you'll have to change it in /etc/hostname.

  • I'm not sure where that answers my question. I know how to change it, but I'd like to find out what is wrong with my hosts file. – ErocM Sep 22 '13 at 17:04
  • My apology, I thought Antoine had already answered the question. I just updated the answer to add some more sauce, hope it helps to some extent. – Terry Wang Sep 23 '13 at 2:13
  • Good information +1 for helping me out with a few items. Thanks again. – ErocM Sep 24 '13 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.