Leaderboard (728 x 90)

Sunday, December 20, 2009

How to change hostname in Linux

run these command

vi /etc/sysconfig/network

edit HOSTNAME parameter to your new hostname
ex: HOSTNAME=server1.example.com

save and restart network and xinetd service with this command
/etc/init.d/network restart
/etc/init.d/xinetd restart

run this command to change current system's hostname
hostname server1.example.com

edit file /etc/hosts following
127.0.0.1 server1.example.com server1

exit shell and re-login to check the result

No comments:

Post a Comment