Last active
July 18, 2019 13:33
-
-
Save 1901/2bac3987fbf2d49ef7ebc744c592e3d9 to your computer and use it in GitHub Desktop.
[CentOS change hostname] #linux #hostname
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CentOS 6.x | |
hostname newHostName | |
vi /etc/sysconfig/network | |
# CentOS 7.x | |
hostnamectl set-hostname newHostName | |
# Change oldHostName to newHostName | |
vim /etc/hosts | |
# reboot and check hostname | |
reboot | |
hostname # CentOS 6.x | |
hostnamectl # CentOS 7.x | |
# ref: https://phoenixnap.com/kb/how-to-set-or-change-a-hostname-in-centos-7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment