Centos – ‘Please configure a fully qualified domain name’ Error

centoscentos6.5emailemail-server

I am running an nginx website on a virtual host and I am trying to set up iRedMail, but this is the error I get when running bash iRedMail.sh.

< ERROR > Please configure a fully qualified domain name (FQDN) in
/etc/hosts before we go further.


etc/sysconfig/network file

NETWORKING=yes
HOSTNAME=mail.website1.com

etc/hosts file (xxx.xx.xxx.xxx is my real server ip address)

127.0.0.1   mail.website1.com mail localhost
::1         localhost

xxx.xx.xxx.xxx website1.com
xxx.xx.xxx.xxx website2.com

What am I doing wrong? Thanks!

Edit: Still coming up with this error.

< ERROR > Please configure a fully qualified domain name (FQDN) in
/etc/hosts before we go further.

Example:

127.0.0.1 mail.iredmail.org mail localhost

This is my new config file:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

xxx.xx.xxx.xxx website1.com
xxx.xx.xxx.xxx mail.website1.com mail
xxx.xx.xxx.xxx website2.com

Best Answer

Your /etc/hosts file should have a separate line defining the system's IP and fully-qualified domain name and the short name on the same line. Remove the "mail.website1.com" and "mail" from the line with 127.0.0.1.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.2.0.6                mail.website1.com mail

Make this change and attempt again.

Also see: Setting the hostname: FQDN or short name?