Re: Address 127.0.1.1
On Fri, May 24, 2024 at 01:40:38PM -0400, Jeffrey Walton wrote:
> On Fri, May 24, 2024 at 11:13 AM Paul M Foster <paulf@quillandmouse.com> wrote:
> > 192.168.254.30 yosemite.mars.lan yosemite
> 127.0.1.1 is traditionally used for the fully qualified domain name
> (fqdn). So I would expect to see 'yosemite.mars.lan', but not
> 'yosemite'.
I don't know why you would expect that. What purpose would that serve?
The goal here is for programs to be able to look up "the IP address"
that belongs to $HOSTNAME.
If the hostname is "yosemite", then "yosemite" must appear in the
/etc/hosts file as an alias for whatever made-up FQDN is being used.
This is what Paul has. What Paul has looks quite reasonable to me.
If 192.168.254.30 is in fact bound to an ethernet interface by a
static configuration (e.g. /etc/network/interfaces) then I would also
say it looks correct.
> Also, fqdn's end in dot '.' to denote the top of the dns tree.
Not in the /etc/hosts file, they don't. You may be thinking of BIND
configuration files.
I've never IN MY LIFE seen trailing dots on hostnames in /etc/hosts.
Reply to: