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

Re: where does `hostname -f` derive the domainname from?



On Tue, 2022-06-28 at 10:10 -0400, Michael Stone wrote:
> On Sun, Jun 26, 2022 at 04:59:26PM -0400, Jim Popovitch wrote:
> > That was the problem.  The bullseye-only system had an /etc/hosts entry
> > without a FQDN.  I removed that and it uses the one in DNS.
> 
> It's generally better to add the FQDN to /etc/hosts instead, to cut down 
> on DNS queries for the local hostname.

In one scenario, sure.  There are plenty of other scenarios where doing
that doesn't make sense.  For example, that bullseye system was one of
20 containers that are spun up from one or more templates with a set of
stock config files (one of which is /etc/hosts).


-Jim P.



Reply to: