CentOS7
From Leaky
Change server hostname
[root@localhost ~]# hostnamectl status
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 399b74f54385ee0d782648666a204c25
Boot ID: 411893b81fee4fb0b865e1b18fd8dd6d
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-123.el7.x86_64
Architecture: x86_64
Set the hostname.
[root@localhost ~]# hostnamectl set-hostname centos7.internal
Check the host name again (Close the session and open new session using putty or console)