Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The easiest way to set your hostname permanently is to choose a hostname different from localhost, because with this specific static hostname, a transient hostname will be used (which is typically not localhost).

The hostnamectl manpage puts it this way:

If a static hostname is set, and is valid (something other than localhost), then the transient hostname is not used.

So unless you really want your hostname to be localhost, you could set your static hostname to something else, like lo and you will no longer be bothered with a transient hostname:

# hostnamectl set-hostname lo

Note: you may (or may not) have to adapt your /etc/hosts file to reflect the change.