A node in the Internet has a name, which is a string without dots ‘.’ in it. This is called the hostname and has no further significance on the Internet.

If the FQDN of the node is published in DNS, than the hostname should be the string before the first dot from the left.

On unix like systems the hostname can be found out by one of the following:

hostname
cat /etc/hostname

The FQDN can be found out by

hostname -f

Different operating systems and ?libc implementations handle the hostname differently, therefore each must be configured specifically to obtain a consistent answer, e.g. when creating scripts which rely on any of: hostname, fqdn or domainname.

See:

Instructions

  • On cloud server disable automatic hostname update:
  • hostname Debian official install