Re: where is /etc/hosts supposed to come from?
On 2009-12-29 00:21:45 +0000, Sam Morris wrote:
> On Tue, 29 Dec 2009 01:03:12 +0100, Vincent Lefevre wrote:
> > 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
I think this is bad (POSIX seems to assume that all machines have
a FQDN).
> never, to my knowledge, had a fully qualified name that could be resolved
> to find out its network address.
The goal of the FQDN is not to find "its network address" (which
is rather meaningless, because a network address is related to a
network interface, not to the machine). Having the FQDN resolved
to 127.0.1.1 on the machine is fine.
> 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
> systems.
What do you mean by "sensible result"? I think you're assuming too
much concerning "hostname -f".
> What would a hypothetical host that only had IPv6 connectivity do?
You still have the IPv4 loopback.
> We certainly don't have a line analogous to the '127.0.1.1' 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.
Do you mean that you don't want to use IPv4 at all and that the
loopback interface only provides IPv6 addresses?
> 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.
/etc/mailname doesn't seem to be specified by POSIX, so that I doubt
that all mail software uses it in practice (Mutt doesn't seem to use
it... its way to get the FQDN is currently buggy, but that's another
story).
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
Reply to: