Check the current hostname

[root@localhost ~]# hostname
[root@localhost ~]#

Issue hostnamectl command in CentOS 7, in this example we are changing the hostname from localhost to askdevops

[root@localhost ~]# hostnamectl set-hostname askdevops

One more change, make this change in /etc/hosts file as well

[root@localhost ~]# vim /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6   askdevops

Save the /etc/hosts file

Oct 10, 2016 by | 24 views
DevOpsRun.com is LIVE!

Articles for DevOps Geeks
MobaXterm Customization
CHMOD Explained!
Bash history powerful tips
Ubuntu bash from Windows