hostname设置方法


hostname设置方法
 
1 检查hostname
linux:~ # hostname
linux
linux:~ # hostname -i
9.110.183.212
2 设置hostname
核心两个文件
文件1
linux:~ # cat /etc/hosts
#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#
 
127.0.0.1 feb01.cn.ibm.com  localhost
 
# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback
 
fe00::0         ipv6-localnet
 
ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
9.110.183.212   linux.site linux
#9.110.183.212   linux.site linux
9.123.106.155    wplccdlvm310.cn.ibm.com
9.123.115.136   dom65ldap.cn.ibm.com
#9.110.183.212   feb01.cn.ibm.com
文件2
vi /etc/sysconfig/network
添加如下行
HOSTNAME=feb01
 
上述两种方式执行之后
#hostname feb01
#reboot

相关内容

    暂无相关文章