Bug 10635 - wrong /etc/hosts?
wrong /etc/hosts?
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: installer (Show other bugs)
7.0
All Linux
medium Severity low
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-04-07 10:59 EDT by Michael Redinger
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-18 21:40:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Redinger 2000-04-07 10:59:26 EDT
After installation, /etc/hosts contains something like this:
127.0.0.1     [hostname] localhost.localdomain localdomain

Generally on Unix, this should be
127.0.0.1     [hostname] localhost

- no localhost.localdomain. Otherwise, the reverse resolution might not
work for some applications. However, maybe there are ways around this in
the C library, don't know ...
Comment 1 Erik Troan 2000-04-10 14:30:59 EDT
Not having the full localhost.localdomain hostname causes problems with
sendmail.
Comment 2 Daniel Roesen 2000-11-29 11:55:01 EST
Accepted, but please change the sequence, so that "localhost" comes _before_
"localhost.localdomain", otherwise 127.0.0.1 always gets resolved to the
annoying "localhost.localdomain" instead of just "localhost" as one expects.

I assume sendmail needs to FORWARD resolve localhost.localdomain to 127.0.0.1,
right?

Reopening and changing version to 7.0 as this problem persists in 7.0, too.
Comment 3 Elliot Lee 2001-07-18 20:22:54 EDT
Apologies for the unresponsiveness of the previous package maintainer...

The first hostname after the IP is always used for IP -> name resolution. The
position of localhost.localdomain vs localhost has no effect.
Comment 4 Daniel Roesen 2001-07-18 21:40:24 EDT
Sorry, but it _has_ an effect, as you point out yourself. It's the _first_ name
which is used for IP->Name resolution.

So with the current

127.0.0.1  localhost.localdomain localhost

127.0.0.1 resolves to "localhost.localdomain". We are (at least) proposing to
use:

127.0.0.1  localhost localhost.localdomain

so that it resolves to just "localhost".

"localhost.localdomain" is just _ugly_ as hell and 127.0.0.1<->"localhost" is
common UNIX, as Michael already pointed out in his original filing.

Actually, changing the 127.0.0.1 line in /etc/hosts is something I do on every
machine I install. "localhost.localdomain" makes me puke (as does sendmail). :-)
Comment 5 Elliot Lee 2001-07-19 13:31:48 EDT
It has no effect in the examples given, which had a hostname.

You need to set a hostname for your computer to get the desired behaviour. If
you don't, I could care less how aesthetically beautiful you think
'localhost.localdomain' is - it works fine :)

Note You need to log in before you can comment on or make changes to this bug.