SUSE Linux 主机名修改

  • Post author:
  • Post category:linux


方法1. 通过yast2管理工具进行配置

在console中运行yast2工具修改主机名(hostname)

# yast2 network

对于配置未经配置的网卡

“Network cards configuration”中”Network cards configuration”中“Configure…”

对于修改已配置网卡的设置

“Network cards configuration”中”Network cards configuration”中“Changev…”

“Network address setup”中“Detailed settings”单击“Host name and name server”

在“Host name”输入框中输入主机名,在“Domain name”中数入域名,如果没有域名,接受缺省的

“local”

方法2. 通过修改配置文件的方式并运行命令修改主机名

修改/etc/HOSTNAME文件,在此文件中保存主机名,例如:

linuxserv1

然后运行命令设置主机名

# /etc/rc.d/boot.localnet start

方法3. 运行 sysctl 动态改变主机名

# sysctl -w kernel.hostname=linuxserv1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24751738/viewspace-707332/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24751738/viewspace-707332/