Instead of changing a hostname on your Redhat 7 server manually by editing /etc/hostname
you may preferably use a dedicated command hostnamectl
to do this job. By default when no other options are supplied the hostnamectl
command will display basic information including static hostname:
[root@rhel7 ~]# hostnamectl Static hostname: rhel7 Icon name: computer Chassis: n/a Machine ID: 75387b56d72b44b380810499805ec28a Boot ID: 6ad251d0e12a10e3af1894eae5fe5cb6 Virtualization: oracle Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo) CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64