On 10/27/23 10:19, Michael Kjörling wrote:
On 27 Oct 2023 09:30 -0400, from poc...@columbus.rr.com (Pocket):
If you're a long form hostname person, then your hostname should be set
to the FQDN of the system.

You have confused me. I started to use Debian about 4 months ago
because I no longer want to build and update my custom built
GNU/Linux systems, which I had been doing for 20 years. Upon moving
to Debian I looked up how to set the host name and was instructed to
set the host name as “host” with out any “domain” part and then set
a FQDN in /etc/hosts. Upon further research I found out that is the
proper what to set the host name since UNIX began.

I believe what Gene refers to when saying "long form host name" is the
fully qualified host name, which includes both the host name and the
domain name within which the host name exists. An example of a fully
qualified host name is debian.example.net, where the domain is
example.net. Note that the domain isn't necessarily exactly the last
two labels of the host name; for example, if you're using mDNS then
the domain would be "local" (fully qualified host name perhaps
"debian.local") or I might have used "debian.example" instead; and if
you work for, say, a large broadcaster in the UK, the domain might be
"bbc.co.uk" and the fully qualified host name might be
"debian.bbc.co.uk".

Running `sudo hostnamectl set-hostname hostname.example.net` will set
the host name of the system persistently to the fully qualified host
name you provide on the command line. Or you can edit /etc/hostname
directly to contain the fully qualified (or single-label) host name
you want to use.

That set-hostname option is not addressed in the manpage I just read, only:
      hostname [NAME]
If no argument is given, print the system hostname. If an optional argument NAME is provided then the command changes the system hostname to NAME. By default, this will alter the pretty, the static, and the transient hostname alike; however, if one or more of --static, --transient, --pretty are used, only the selected hostnames are changed. If the pretty hostname is being set, and static or transient are being set as well, the specified hostname will be simplified in regards to the character set used before the latter are updated. This is done by removing special characters and spaces. This ensures that the pretty and the static hostname are always closely related while still following the validity rules of the specific name. This simplification of the hostname string is not done if only the transient and/or static hostnames are set, and the pretty hostname is left untouched.

The static and transient hostnames must each be either a single DNS label (a string composed of 7-bit ASCII lower-case characters and no spaces or dots, limited to the format allowed for DNS domain name labels), or a sequence of such labels separated by single dots that forms a valid DNS FQDN. The hostname must be at most 64 characters, which is a Linux limitation (DNS allows longer names).

I suggest you file a bug against this command to among other things, clean up the language to refer to FQDN's or aliases which we are familiar with, "static, transient or pretty" as so called choices. If using new words for old, either define them so we do understand or remove them in favor of names we are familiar with.
Then edit /etc/hosts such that it also reflects the changed hostname.


Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis

Reply via email to