Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Please fix your /etc/hosts file...

  1. #1
    ipguru99 is offline Active Member
    Join Date
    Jun 2006
    Posts
    32
    Rep Power
    9

    Default Please fix your /etc/hosts file...

    I get this error on upgrading from:
    Release 3.1.3_GA_474.SuSEES9_20060609153405 SuSEES9 NETWORK edition

    to 3.1.4. So this is a box that has been working (ok, except for the purge thing.. which led me to the upgrade).

    Now the box says the /etc/hosts is broken. When I `hostname`, I get mail.xxxxxx.com. When I ping it, dig it from another server... Everything is fine with dns, from other servers. On the box itself I have no problem.

    The exact error is:
    HTML Code:
    ERROR: Installation can not proceeed.  Please fix your /etc/hosts file
            to contain:
    
            <ip> <FQHN> <HN>
    
            Where <IP> is the ip address of the host,
            <FQHN> is the FULLY QUALIFIED host name, and
            <HN> is the (optional) hostname-only portion
    Any help? my /etc/hosts looks just like that?
    HTML Code:
    # IP-Address  Full-Qualified-Hostname  Short-Hostname
    127.0.0.1       localhost
    xx.xx.xx.xx  mail.xxxxxxxxxxx.com mail
    Thanks!

  2. #2
    jholder's Avatar
    jholder is offline Former Zimbran
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    20

    Default

    My ideas are purely a shot in the dark, but perhaps we can filter this down.

    Did you change anything else? IP address, install any new packages?

    What are the permissions for the hosts file? What about IPv6? I know that it has been known to cause problems. Is SELinux off?

    Is this a server with a live IP or is this all behind a NAT Firewall?

    Also, Please post your /tmp/install.log.xxxx
    Perhaps there will be something in there.

    Thanks
    john
    Quote Originally Posted by ipguru99
    I get this error on upgrading from:
    Release 3.1.3_GA_474.SuSEES9_20060609153405 SuSEES9 NETWORK edition

    to 3.1.4. So this is a box that has been working (ok, except for the purge thing.. which led me to the upgrade).

    Now the box says the /etc/hosts is broken. When I `hostname`, I get mail.xxxxxx.com. When I ping it, dig it from another server... Everything is fine with dns, from other servers. On the box itself I have no problem.

    The exact error is:
    HTML Code:
    ERROR: Installation can not proceeed.  Please fix your /etc/hosts file
            to contain:
    
              
    
            Where  is the ip address of the host,
             is the FULLY QUALIFIED host name, and
             is the (optional) hostname-only portion
    Any help? my /etc/hosts looks just like that?
    HTML Code:
    # IP-Address  Full-Qualified-Hostname  Short-Hostname
    127.0.0.1       localhost
    xx.xx.xx.xx  mail.xxxxxxxxxxx.com mail
    Thanks!

  3. #3
    ipguru99 is offline Active Member
    Join Date
    Jun 2006
    Posts
    32
    Rep Power
    9

    Default

    thanks for the ideas... I went ahead and commented out the part in utilsfunc.sh that gets called in the install.sh. It was
    HTML Code:
    hostname --fqdn
    . The upgrade ran just fine after that... and seems to be ok (see below)

    I did see a whole bunch of install.log.xxx files, but mostly they contain two lines that don't seem to have anything to do with my attempted upgrade?

    I didn't look at the permissions on the hosts file... I just looked now and they are
    -rw-r--r-- 1 root root 743 2006-07-22 21:55 /etc/hosts
    That looks normal to me. I never thought about the ipv6 stuff until you mentioned it.. and yes, I have heard of that doing weird things (that should be promising over the next 10 years ;-). It is behind a firewall

    Bad part about all of this. It broke the zmpurge script you helped me fix!!.. yeah, now all the junk is staying in the Junk folders again. I just checked this a.m. and nothing has been deleted since 2 days before I completed the upgrade (I have my spam purge at 2 days).

    So, back in the root crontab until I figure out why that isn't working. BUT... the upgrade to 3.1.4 seems to have kicked the spam into gear. We are still getting too high a percentage coming through, but at least now the stuff I have tagged with "this_is_probably_spam" is getting sent directly to their junk. Funny how all of this stuff is changing, and I haven't touched anything since I configured it. I guess that is why they keep fixing stuff. I love this product, though...

    Thanks for resonding!

    UPDATE: just looked at the purge thing again... seems the same change just needs to be made... Sorry.
    Last edited by ipguru99; 07-23-2006 at 09:03 AM.

  4. #4
    padraig's Avatar
    padraig is offline Elite Member
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Post /etc/hosts

    Hi,

    I has the same issue installing on FC5
    it seems the /etc/hosts file needs 3 entries on each line i.e.

    ip FQHN HN

    so your /etc/hosts should look something like:

    # IP-Address Full-Qualified-Hostname Short-Hostname
    127.0.0.1 localhost.localdomain localhost
    xx.xx.xx.xx mail.xxxxxxxxxxx.com mail

    HTH,
    Padraig.

  5. #5
    ipguru99 is offline Active Member
    Join Date
    Jun 2006
    Posts
    32
    Rep Power
    9

    Default

    thanks... I did all of those, and even tried to make sure there weren't any whitespaces before the file started... something the zimbra people told me.

    In the end, since I knew the hostname was correct, I just commented out the part of utilfunc.sh (called from install.sh) that asked for the hostname. It worked fine and the upgrade is running well (doing a much better job with spam anyway).

    I know this isn't ideal, but the error didn't make any sense.. the box was running just fine with the /etc/hosts it had?

    Thanks everyone for the suggestions. Zimbra is supposedly looking into it, and it was on SuSE 9... which I guess is still really beta (or was..).

  6. #6
    mohz is offline Starter Member
    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    4

    Default

    Had this one today, fixed it by doing:

    Checking hostname using the command: hostname --fqdn

    the output should match the fqdn in the hosts file, or it wont work.

  7. #7
    Lukaesch is offline Starter Member
    Join Date
    Aug 2011
    Posts
    1
    Rep Power
    3

    Default

    Quote Originally Posted by mohz View Post
    Had this one today, fixed it by doing:

    Checking hostname using the command: hostname --fqdn

    the output should match the fqdn in the hosts file, or it wont work.
    the same here ! on debian you can change your hostname by editing /etc/hostname

  8. #8
    Join Date
    Oct 2008
    Posts
    51
    Rep Power
    6

    Default

    For anyone with this problem in the future.

    Your hostname is taken from your network script, which may vary on your OS.

    I use RedHat, and Fedora. My host name is not set it /etc/hosts. That is what is used for a reference from IPs to logical names.

    Fedora and RedHat users, your host name can be changed in /etc/sysconfig/network.

    Then to change it for now without taking down your network:
    # hostname name.domain.suffix

    I do not know what network manager will do to this host name, if anything. I do not use network manager myself.

    Before continuing don't forget to shutdown sendmail, and apache 'httpd'.

  9. #9
    troublemaker's Avatar
    troublemaker is offline Senior Member
    Join Date
    Feb 2009
    Location
    RUSSIA, Far East, Birobidzhan
    Posts
    52
    Rep Power
    6

    Default

    trying to install 6.0.15 on ubuntu 10.4. WTH!!?

    Code:
    # cat /etc/hosts
    127.0.0.1	localhost.localdomain	localhost
    127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
    172.21.122.149 vm09.eao.drsk.ru
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost.localdomain ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    #127.0.0.1	localhost.localdomain	localhost
    Code:
    # grep `hostname --fqdn` /etc/hosts
    127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
    Code:
    # grep `hostname` /etc/hosts
    127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
    what else does your script looks for? it still requires "fqdn"

    the solution I found: add one single character in regexp:

    if perl -e "while (<>) { next if /^#|^127.0/; exit 1 if /\s+$HOSTNAME\s+/; }" /etc/hosts; then

    with

    if perl -e "while (<>) { next if /^#|^127.0/; exit 1 if /\s+\$HOSTNAME\s+/; }" /etc/hosts; then

    to "Quote the next metacharacter" (perlre - perldoc.perl.org)

    To check that I'm not wrong, I executed this command as regular ciommand from console:

    Code:
    $ perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+\$HOSTNAME\s+/; }" /etc/hosts
    11111211111
    but what about older command? lets see:

    Code:
    $ perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+$HOSTNAME\s+/; }" /etc/hosts
    1111111111
    So, the original command does not locate hostname at all, while corrected one locates exactly one occurrence. Lets do some more checks. Adding another fqdn into /etc/hosts:

    Code:
    $ cat /etc/hosts
    127.0.0.1	localhost.localdomain	localhost
    127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
    172.21.122.149 vm09.eao.drsk.ru
    172.21.122.149 vmubuntu.eao.drsk.ru vmubuntu
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost.localdomain ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    #127.0.0.1	localhost.localdomain	localhost
    WTH again:

    Code:
    $ perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+\$HOSTNAME\s+/; }" /etc/hosts
    111111211111
    $perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+$HOSTNAME\s+/; }" /etc/hosts
    111121111111
    something mystical: both commands locate the hostname now!

    Conclusion: the install script looks for "fqdn with address not starting with 127.0". But it is no one's business.
    Regards,
    Sergei from Siberia

    The word "traitor" is the antonym to the word "patriot".

  10. #10
    jrv
    jrv is offline Active Member
    Join Date
    Nov 2008
    Posts
    28
    Rep Power
    6

    Default

    Quote Originally Posted by troublemaker View Post
    if perl -e "while (<>) { next if /^#|^127.0/; exit 1 if /\s+$HOSTNAME\s+/; }" /etc/hosts; then

    ...Conclusion: the install script looks for "fqdn with address not starting with 127.0". But it is no one's business.
    The perl script is looking for the hostname as an FQDN and as a non-loopback address in /etc/hosts. Ubuntu, at least, seems to install the host as a loopback only (127.0.1.1).

    Removing this test from util/utilfunc.sh seems to work. Putting a non-loopback IPv4 address is not generally good practice so it is not clear why this is demanded.

    It might be useful to change the text of the error message to reflect what Zimbra is actually testing for.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. centos 5 zimbra 4.5.6 no statistics
    By rutman286 in forum Installation
    Replies: 9
    Last Post: 08-14-2007, 09:30 AM
  2. Opensource backup Question.
    By nfear24 in forum Administrators
    Replies: 3
    Last Post: 03-31-2007, 11:47 PM
  3. Replies: 5
    Last Post: 03-01-2007, 03:20 AM
  4. Traslation SVN tree status
    By meikka in forum I18N/L10N - Translations
    Replies: 7
    Last Post: 02-13-2007, 11:13 AM
  5. M3 problem with shares
    By titangears in forum Users
    Replies: 4
    Last Post: 01-12-2006, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •