After my CentOS 7.1 virtual machine installation, I got this hostname :

[root@localhost ~]# hostname

Now, to set the correct hostname (here : “centos7”), just launch this command :

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

Verify :

[root@localhost ~]# hostname
[root@localhost ~]# hostnamectl
   Static hostname: centos7
         Icon name: computer
           Chassis: n/a
        Machine ID: 281f2759a50e48069bd9e59b631f7ede
           Boot ID: 518deb41ebac404c8a7b2030741bbf63
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-229.20.1.el7.x86_64
      Architecture: x86_64    Send article as PDF   

Leave a Reply

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