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