[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where is /etc/hosts supposed to come from?



On Sun, 27 Dec 2009 14:22:53 -0800, Steve Langasek wrote:

> On Sun, Dec 27, 2009 at 01:25:55PM -0800, Daniel Moerner wrote:
>> On Sun, Dec 27, 2009 at 12:50 PM, Russell Coker <russell@coker.com.au>
>> wrote:
>> > I've just done a debootstrap install of Lenny, and /etc/hosts doesn't
>> > exist. Where is /etc/hosts supposed to come from?  I think it should
>> > have something like the following (copied from an ancient Debian
>> > install).
> 
>> > 127.0.0.1       localhost
> 
>> > # 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
>> > ff02::3 ip6-allhosts
> 
>> For debootstrapped installs, it's not automatically created by
>> anything. The recommended setup is almost the same as that, although as
>> Neil said you still need to add a hostname on to the first line.
> 
> No, the hostname should be set on a *separate* line, mapped to
> 127.0.1.1, as we've been doing for years now.  Setting an equivalence
> between localhost and the hostname causes all manner of problems due to
> hostname canonicalization.

Details in <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099>. I 
do wonder, however, why the system hostname has to appear in /etc/hosts 
at all? Programs that want to find it out can read /etc/hostname 
directly, after all. And wtf is 'localdomain' for, anyway?

-- 
Sam Morris



Reply to: