Bob Proulx
2021-Feb-08 20:54 UTC
[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
Chris Green wrote:> Isn't it just 'hostname -f'? > > chris$ hostname -f > t470.zbmc.eu > chris$ hostname > t470The hostname -f option is a "new-ish" Linux specific option. It's not portable. And because it works by doing a reverse DNS lookup it depends upon live network connectivity at that moment working for the network lookup and the results are spotty depending upon how DNS is set up and how many IP addresses are configured on the host. It's problematic. Bob
Chris Green
2021-Feb-08 20:58 UTC
[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
On Mon, Feb 08, 2021 at 01:54:12PM -0700, Bob Proulx wrote:> Chris Green wrote: > > Isn't it just 'hostname -f'? > > > > chris$ hostname -f > > t470.zbmc.eu > > chris$ hostname > > t470 > > The hostname -f option is a "new-ish" Linux specific option. It's not > portable. And because it works by doing a reverse DNS lookup it > depends upon live network connectivity at that moment working for the > network lookup and the results are spotty depending upon how DNS is > set up and how many IP addresses are configured on the host. >Yes, OK, just a thought. -- Chris Green
Nico Kadel-Garcia
2021-Feb-09 00:25 UTC
[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
On Mon, Feb 8, 2021 at 3:59 PM Bob Proulx <bob at proulx.com> wrote:> > Chris Green wrote: > > Isn't it just 'hostname -f'? > > > > chris$ hostname -f > > t470.zbmc.eu > > chris$ hostname > > t470 > > The hostname -f option is a "new-ish" Linux specific option. It's not > portable. And because it works by doing a reverse DNS lookup it > depends upon live network connectivity at that moment working for the > network lookup and the results are spotty depending upon how DNS is > set up and how many IP addresses are configured on the host. > > It's problematic. > > BobIt looks in /etc/hosts first, which works very well when DNS is unavailable and when the host his publishing a dynamic DNS entry.