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.