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

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

On Tue, 29 Dec 2009 01:03:12 +0100, Vincent Lefevre wrote:

> On 2009-12-28 23:41:38 +0000, Sam Morris wrote:
>> 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?
> Programs may need the FQDN, even without any network connection (for
> instance, even local mail messages should have a Message-Id). And
> /etc/hostname doesn't necessarily contain the FQDN.

Hm, but shouldn't they use another method to get it? My laptop has no 
FQDN when it is not connected to a network, and even when it is, it has 
never, to my knowledge, had a fully qualified name that could be resolved 
to find out its network address.

Conversely, I have used servers that had multiple network interfaces, 
some of which even have multiple network addresses assigned to them. 
'hostname -f' did not yield a sensible result on a couple of these 

What would a hypothetical host that only had IPv6 connectivity do? We 
certainly don't have a line analogous to the '' hack in /etc/
hosts for ipv6, and I'm not even sure what such a line would look like, 
since ::1 has a /128 netmask.

As for mail, we already appear to have an /etc/mailname file for MTAs and 
MUAs to use for finding out the 'canonical' name of the host for message-
IDs and the like.

> Also, it is required that the FQDN be resolvable (but I wonder whether
> this is useful in practice).

Sam Morris

Reply to: