centos method to set fqdn of full domain name and hostname

  • 2020-05-07 20:47:01
  • OfStack

To view


[root@rdo ~]# hostname
rdo
[root@rdo ~]# hostname -f
rdo.test.com

To achieve this, you need to modify two files

Edit /etc/sysconfig/network, you need to add 1 line, remember HOSTNAME, must be capitalized.


# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rdo

Edit /etc/hosts, add 1 line


192.168.178.2   rdo.test.com    rdo

Exit ssh, login again, should take effect.


Related articles: