1754168 Members
2864 Online
108811 Solutions
New Discussion юеВ

change hostname

 
SOLVED
Go to solution
file system
Frequent Advisor

change hostname

Hi all
I have box of RedHat Enterprise Linux ES 3.0

I must the hostname of it.
what sort of file should I modify to change the hostname.?
please.
4 REPLIES 4
Steven E. Protter
Exalted Contributor
Solution

Re: change hostname

Shalom filesystem,

You change the hostname by editing the following file:

vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=cleartux

You can set GATEWAY and NIS invormation there as well.

Then:

service network restart

hostname
# to check the change worked.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alexander Chuzhoy
Honored Contributor

Re: change hostname

In steps described by Steven the King you'd still see the old hostname (until reboot).
If you want the hostname to change without reboot do in addition to suggested by Steve:
echo newhostname > /proc/sys/kernel/hostname


Best regards.
Ivan Ferreira
Honored Contributor

Re: change hostname

You can edit /etc/sysconfig/network and change the hostname.

You can use

hostname newhostname

To set the new hostname immediatly

You must also ensure that the /etc/hosts file reflects the changes.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Sivakumar TS
Honored Contributor

Re: change hostname


Hi,

Try #hostname

and #uname -S


HtH,

Siva.

Nothing is Impossible !