CentOS7 change hostname

I started switching recently (i know i should have probably started earlier but meh, was busy) switching boxes to CentOS7. Changing the hostname is slightly different now:

[root@500748 ~]# hostnamectl status
Static hostname: beast1.domain.com
Icon name: computer-desktop
Chassis: desktop
Machine ID: e289f5250bd548609d5989766573ab49
Boot ID: 844dbb05561c4c599aad84d9f685d0e8
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-229.el7.x86_64
Architecture: x86_64

So in order to change the hostname you would do:

hostnamectl set-hostname my.new.hostname


Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge