Modify the linux hostname

1.[root@www ~]# vim /etc/sysconfig/network

NETWORKING=yes whether to use the network function

HOSTNAME=www hostname

2.[root@www ~]# vim /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.146.128 www


Restart after modification, permanent modification

Temporary modifications can also be made using the hostname hostname

man hostname

hostname - show or set the system's host name to query or modify the host name


[root@www ~]# hostname

www

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324522353&siteId=291194637