Linux下修改主机名为linuxidc
步骤一、运行vi /etc/sysconfig/network命令
NETWORKING=yes
HOSTNAME=linuxidc
步骤二、运行hostname linuxidc命令
步骤三、运行vi /etc/hosts命令
192.168.1.121 linuxidc # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost
::1 linuxidc localhost6.localdomain6 localhost6
步骤四、运行reboot命令重新启动电脑后或者使用service network restart命令重新启动网络服务后生效
修改前的/etc/sysconfig/network文件默认内容为
NETWORKING=yes
HOSTNAME=bogon
修改前下的/etc/hosts文件默认内容为
192.168.1.121 bogon # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost
::1 bogon localhost6.localdomain6 localhost6
Linux上修改主机名对Oracle启动关闭的影响 http://www.linuxidc.com/Linux/2014-04/99888.htm
如何在Linux中显示和设置主机名 http://www.linuxidc.com/Linux/2013-12/93596.htm
Linux更改主机名 http://www.linuxidc.com/Linux/2013-10/91920.htm
Linux下更改主机名(Ubuntu+RedHat) http://www.linuxidc.com/Linux/2013-01/77920.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/101457.htm