myGUIDE

|

random notes, random thoughts

How to change hostname in Linux

October 7th, 2009 at 23:23

In order to change the hostname of your linux machine, you can do the following:

1) Edit file /etc/sysconfig/network using your favourite editor, say using vi.

[root@mycomp]# vi /etc/sysconfig/network

2) Look for the line with HOSTNAME in it and change the entry to the desired hostname

HOSTNAME=mycomp.mydomain.com

3) Save the file and restart xinetd service

[root@mycomp]# /sbin/service xinetd restart

That’s it! You have just changed your hostname in Linux platform

Tags: ,

Leave a Reply

Connect with Facebook

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">