CentOS 7 how to change hostname
After I’ve created my home server I’ve tried to change it’s host name by going to /etc/sysconfig/network. For my surprise it was empty. Then I’ve recalled that in version 7 CentOS started using systemd. Hence the location changed.
New place to edit is /etc/hostname
The inconvenience of editing file directly is that system reboot is required to apply the change.
Alternative method is to use Network Manager tool by invoking nmtui.
and then execute:
systemctl restart systemd-hostnamed
You can type hostname to validate the change.
Leave a Reply
You must be logged in to post a comment.