Try this on for size. It's what the command actually does, what's actually common with all other operating systems (even HP-UX), and what it deprecates is what the Tobias hostname(1) manual has been deprecating since around the turn of the century.
http://jdebp.info/Proposals/Debian-hostname.xml
Many guides even for Debian actually stick to the conventional use. This one has "linux.example.com" as the hostname from "hostname" and "hostname -s" shortening it.
https://hostingdata.co.uk/linux-hostname-command-tutorial-examples/
This is, ironically, why the old confusing hostname(1) manual has all of these backpedallings about not using "hostname -fqdn". It's a misfeature that no other implementation has, invented peculiarly for Debian and the peculiar Debian notion that we still live in 1981.
The Debian command was done badly in the middle-1990s, and the hostname(1) manual has been trying to un-dig the hole ever since, the hostname(7) manual having the real 40-year convention.
@vinc17
Since the 1980s, everyone else has been happy to have and document multi-label names as the norm.
RedHat's doco, for example, has almost equally long said to use a multiple-label name as the hostname. Just like the actual Unix operating systems all did before it.
RHEL 9 says "new-hostname.example.com" for example.
On the contrary, multiple-label hostnames work with most softwares, even UUCP being able to have multiple-label names in bang paths, because it's been the convention since at least 1983.
Debian has had this wrong for a long time.
Debian's focus on putting a short hostname in and letting the HOSTS file expand it using name qualification and canonicalization mechanisms is straight out of the pre-DNS times.
And if anyone's wondering "Why 'monet'?" it's because this goes back to 4.2BSD, whose hostname(7) manual page used to give "monet.Berkeley.EDU" as the example host name, which was actually a real host.
HP just deleted the name entirely when editing UCB out of its HP-UX doco, which made the hostname(7) manual page read rather strangely.
Debian has gone the route of changing to "example.com". FreeBSD/OpenBSD still have "Berkeley.EDU".
That's how long-standing this is.
That's where that mailing-list message went wrong. This is _not_ the case for #Debian, either.
The host name can contain multi-label names. Have a read of hostname(7). It gives "monet.example.com" as an example hostname.
Put "monet.example.com" in as a hostname, and "monet.example.com" comes out of "hostname" whilst "monet" comes out of "hostname -s".
Just like all the other operating systems.
As I said, this is the long-standing cross-platform usage.
You're right about "hostname -f" being the more common need. But across operating systems it's actually even simpler:
"hostname" gives the full hostname, with "-f" sometimes available as a do-nothing flag, and "hostname -s" shortens it.
So actually "hostname" on its own is the usage that was wanted by that user, and should be recommended by the manual page.
https://man.freebsd.org/cgi/man.cgi?query=hostname&sektion=1
https://illumos.org/man/1/hostname
https://man.openbsd.org/hostname.1
https://github.com/freebsd/freebsd-src/blob/main/bin/hostname/hostname.c#L67
I thought that you might be interested, @vinc17 , for obvious reasons. I think that there's a lot more that confuses users on that manual page.
For example: It could clarify that "--domain" basically turns all 5 commands into "dnsdomainname". If "hostname --domain" is problematic, then so too is "ypdomainname --domain".
One of the reasons that the hostname(1) manual page for #Debian is hard to grasp is that its description is wrong.
It says that "domainname" uses the gethostname(2) function. In fact, all three of "ypdomainname", "nisdomainname" and "domainname" use the getdomainname(2) function.
It gets this right in the "SET NAME" section. The "GET NAME" section needs correcting to match the other section.
https://manpages.debian.org/unstable/hostname/hostname.1.en.html