centos change hostname permanently

change hostname under centos

#hostname  newhostname 

#hostname 

when poweroff, the hostname is still stale without changed

--------------------------

to change hostname permanently.following these steps

#vi /etc/hosts

127.0.0.1   newhostname localhost

#vi /etc/systemconfig/network

HOSTNAME=newhostname

#/etc/init.d/network  restart

if the above command not work, the just reboot the system.

猜你喜欢

转载自ylzhj02.iteye.com/blog/2033486
今日推荐