nmcli general hostname

Category: Local Network & Public Hosting

nmcli general hostname

Print the hostname NetworkManager manages

NetworkManager can set and hold the system hostname, so this is one more way to check what the machine calls itself on the LAN. Run nmcli general hostname myserver with a name argument to change it persistently. Compare with hostnamectl, which manages the same value through systemd.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.