linux配置主机名

来源:互联网 发布:淘宝店开了一年没生意 编辑:程序博客网 时间:2024/06/10 09:03

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

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=spring1.lc

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

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       lc1.spring localhost
::1             localhost6.localdomain6 localhost6

也可以临时指定:

[root@lc1 ~]# hostname spring1.lc

                                              

0 0