[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use

Darren Tucker dtucker at dtucker.net
Tue Feb 9 16:48:19 AEDT 2021


On Tue, 9 Feb 2021 at 11:35, Nico Kadel-Garcia <nkadel at gmail.com> wrote:
[about hostname -f]
> It looks in /etc/hosts first, which works very well when DNS is
> unavailable and when the host is publishing a dynamic DNS entry.

It *might* look in /etc/hosts first, depending on what's in
/etc/nsswitch.conf.  At least with glibc anyway, other libc
implementations might do something different again.  Anyway it's far
enough into "it depends" that it's not something I'd want to rely on,
and as it stands it looks like we don't need to.

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list