hostnamectl

The command that shows and sets the machine's host name, including the static name kept across reboots.

In more detail

hostnamectl set-hostname writes /etc/hostname. The plain hostname command sets only a transient name that the next boot forgets.

Example

hostnamectl set-hostname servera.lab.example.com

Related terms

Taught in

References

Certification courses