您的位置:首页 > 其它

修改 redhat 主机名

2013-07-28 14:43 204 查看
需要修改两处地方,重启网卡和网络服务。

[root@localhost jdk1.6.0_43]# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=master

[root@localhost jdk1.6.0_43]# vi /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1               master localhost

[root@localhost jdk1.6.0_43]# /etc/init.d/network restart

Shutting down interface eth0:  [  OK  ]

Shutting down loopback interface:  [  OK  ]

Setting network parameters:  [  OK  ]

Bringing up loopback interface:  [  OK  ]

Bringing up interface eth0:  [  OK  ]

[root@localhost jdk1.6.0_43]# service network restart

Shutting down interface eth0:  [  OK  ]

Shutting down loopback interface:  [  OK  ]

Setting network parameters:  [  OK  ]

Bringing up loopback interface:  [  OK  ]

Bringing up interface eth0:  [  OK  ]

查看修改过后的效果

[root@localhost jdk1.6.0_43]# hostname

master
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: