How to change the hostname in linux

Hi, I am trying to change the host name of a linux machine. I have modified /etc/hosts as follows :

127.0.0.1 localhost.localdomain localhost ##< IP ADDRESS>

/etc/nsswitch.conf is modified as follows : #hosts: db files nisplus nis dns ##hosts: files nisplus dns hosts: files

/etc/sysconfig/network ##HOSTNAME= HOSTNAME=

Then I have executed these on the shell : hostname

service xinetd restart

After executing these steps, my machine is not taking the new hostname. If I execute #hostname

I get hostname as (none)

Can anyone tell me what is that which I am missing here. Thanks in Advance!

Reply to
guddu
Loading thread data ...

This is for the resolver only, not for the local hostname.

Depending on your distro it might be possible to edit /etc/hostname. You can always set the hostname manually by using "hostname "

Sven

--
"If you continue running Windows, your system may become unstable."
(Windows 95 BSOD)
 Click to see the full signature
Reply to
Sven Geggus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.