How Do I Change My Linux Hostname Permanently?
Contents How Do I Permanently Change the Hostname in Linux 7? How to Change Hostname in Centos/Rhel 7 Use Hostname Control Utility: Hostnamectl. Use...
Contents
How do I permanently change the hostname in Linux 7?
How to change hostname in CentOS/RHEL 7
- use hostname control utility: hostnamectl.
- use NetworkManager command line tool: nmcli.
- use NetworkManager text user interface tool : nmtui.
- edit /etc/hostname file directly (a reboot afterwards is required)
How permanently change hostname in Linux without reboot?
To do this issue the command sudo hostnamectl set-hostname NAME (where NAME is the name of the hostname to be used). Now, if you log out and log back in, you’ll see the hostname has changed. That’s it–you’ve changed the hostname without having to reboot the server.