Created
October 1, 2016 17:06
-
-
Save dungmanh88/3171e68cbbf0da177979660c36a80b3e to your computer and use it in GitHub Desktop.
Change hostname on Centos 7
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
hostname <new-hostname> | |
echo "<new-hostname>" > /etc/hostname | |
replace old-hostname by new-hostname in /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hostnamectl set-hostname --> will change /etc/resolv.conf
replace old-hostname by new-hostname in /etc/hosts
re-login