If you are new to linux you probably will ask how to change the hostname of you computer. (A hostname is the unique name by which a network attached device is known on a network.) If you enter the wrong hostname during the installation, and you need to change the hostname, here is the solution:-
- Edit file /etc/sysconfig/network using your favourite editor. In my case is nano. So i’ll enter nano /etc/sysconfig/network
- Look for HOSTNAME=xxxxxx
- Change the xxxx to the name you wish to set for your computer. (ex: HOSTNAME=techiecorner.com)
- Save the file and restart the xinetd service. (ex: type service xinetd restart in your shell)
- Done! You have just changed your hostname in Linux platform
Suse :
1) u have to change host name in : vi /etc/HOSTNAME
2) after that vi /etc/hosts — change here also ….
3) Restart the Network services ” /etc/init.d/network restart
Then do #hostname ….
U will get expected result
rhel5 :
to change hostname on rhel5
#vi /etc/sysconfig/network
hostname:
save and exit
# vi /etc/hosts
edit
save and exit
#service network restart
#service xinetd restart
done