Package: hostname
Version: 2.95

hostname -s
on a host with a hostname that does not resolve in the DNS
behaves differently on Debian  as on FreeBSD/OpenBSD/AIX/MacOsX.

On Debian when the hostname does not resolve in the DNS
hostname -s
returns "hostname: Unknown host" message.
On FreeBSD/OpenBSD/AIX/MacOsX when the hostname does not resolve in the DNS
hostname -s
returns short host name (no matter if the hostname resolves or not).

hostname man page does not say anything about whether the hostname should 
resolve or not.
-s, --short
  Display the short host name. This is the host name cut at the first dot.


Steps to Reproduce:
run hostname -s on a server whose Fully qualified hostname does not resolve in 
the DNS.

Actual results:

[root ~]# hostname some.thing.stupid
[root ~]# hostname
some.thing.stupid
[root ~]# hostname -s
hostname: Unknown host

Expected results:

[root ~]# hostname some.thing.stupid
[root ~]# hostname
some.thing.stupid
[root ~]# hostname -s
some

See also
https://bugs.launchpad.net/ubuntu/+source/hostname/+bug/389602
where reporter says that:
"The documentation states that -s just trims the domain off if it exists, but 
that's not what it does.
Either it should behave exactly that way or the doc should be updated."





--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to