CentOS 7
Ads

Set Hostname
2014/07/13
 
The example for setting Hostname of your system.
[1] Change hostname. (but if rebooting, it will be back).
# show current hostname

[root@localhost ~]#
localhost.localdomain
# change hostname

[root@localhost ~]#
hostname dlp.srv.world

[root@localhost ~]#
dlp.srv.world
# just changed

[2] Change hostname permanently.
[root@localhost ~]#
hostnamectl set-hostname dlp.srv.world
# show status

[root@localhost ~]#
   Static hostname: dlp.srv.world
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 98a49a78fc9ad91f1b99304c75b94c31
           Boot ID: 09b95ce0bc7f4179b1e8a011ed314c6b
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-123.4.2.el7.x86_64
      Architecture: x86_64
 
Tweet