How to change hostname in centos7
Obviously you can do it manually, but there are a number of tools that can do it for you:
- hostnamectl command : Control the system hostname. This is recommended method.
- nmtui command : Control the system hostname using text user interface (TUI).
- nmcli command : Control the system hostname using CLI part of NetworkManager.
Tip stolen from here