Bug 483244

Summary: setup package doesn't create /etc/hosts
Product: [Fedora] Fedora Reporter: Daniel Mach <dmach>
Component: setupAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ackistler, ovasik, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-26 12:40:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 471381    

Description Daniel Mach 2009-01-30 14:07:44 UTC
/etc/hosts is created by anaconda during installation.
I'd prefer to have a default file with localhost and localhost6 records.

Could you include /etc/hosts with following content?
127.0.0.1       localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

Comment 1 Allen Kistler 2009-02-20 14:15:00 UTC
See Bug 486461 and Bug 486457.

I'd suggest the contents of /etc/hosts should be
127.0.0.1       localhost.localdomain localhost
::1             localhost.localdomain localhost

for reasons discussed in those bugs.

Comment 2 Daniel Mach 2009-02-20 17:04:17 UTC
(In reply to comment #1)
> See Bug 486461 and Bug 486457.
> 
> I'd suggest the contents of /etc/hosts should be
> 127.0.0.1       localhost.localdomain localhost
> ::1             localhost.localdomain localhost
> 
> for reasons discussed in those bugs.

Do you have any special reason for that?

::1             localhost6.localdomain6 localhost6
is a standard /etc/hosts record in Fedora.
It's created by anaconda during installation.

Comment 3 Allen Kistler 2009-02-20 19:14:20 UTC
localhost6 breaks IPv6 functionality.  Probably the only reason I haven't seen it pointed out before is that people still use IPv4 mostly, even when they're dual-stacked.

Applications refer to the loopback as localhost, which needs to be true independent of address family.  Bug 486457 is the request to get anaconda to create /etc/hosts as described in Comment #1 above.  I know localhost6 is the current Fedora practice (I doubt it's as formal as a standard), but the practice needs to be changed.

The idea is to make IPv6 work out of the box.

FWIW, Gentoo appears (according searches I've done) to do something like
127.0.0.1 localhost localhost4
::1       localhost localhost6

which would also work, since the important thing is that localhost is *both* an IPv4 address *and* an IPv6 address for the loopback.  Although it has a nice symmetry to it, I'd discourage the existence of localhost4 as much I would discourage localhost6.  Having just localhost is the "right" thing, but more importantly it works and localhost6 doesn't.

Comment 4 Ondrej Vasik 2009-02-25 16:33:14 UTC
Ok, discussed a bit with reporter and I'll probably do following soon:

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

and multi on in /etc/host.conf

It should make IPv6-only machines work out-of-the-box and without modifications of configuration files and should grant backward compatibility - as there already exists localhost6.localdomain6 in some configuration files in Fedora.

Comment 5 Allen Kistler 2009-02-25 17:53:11 UTC
*** Bug 486457 has been marked as a duplicate of this bug. ***

Comment 6 Ondrej Vasik 2009-02-26 12:40:56 UTC
Creating /etc/hosts with content described in comment #4, built as
setup-2.8.1-1.fc11, closing RAWHIDE