hostnamectl

hostnamectl

The hostnamectl command is a Linux command that can be used to manage the hostname of a system. The hostname is the name that is used to identify a system on a network.

Here are some examples of how to use the hostnamectl command:

# To show the current hostname:
hostnamectl

# To set the hostname to a static value:
hostnamectl set-hostname myhostname

# To set the hostname to a transient value:
hostnamectl set-hostname --transient myhostname

# To show the full hostname:
hostnamectl --full

# To show the domain name:
hostnamectl --domain

help

breakdown

Last updated