Operating System - Linux
1827894 Members
1576 Online
109969 Solutions
New Discussion

Re: how to change the hostname?

 
Kenneth Leung_2
Frequent Advisor

how to change the hostname?

I would like to change the hostname for my server, which is running Red Hat ES 3. Can anyone teach me how to do it? Many thanks
4 REPLIES 4
Alexander Chuzhoy
Honored Contributor

Re: how to change the hostname?

edit the file /etc/sysconfig/network

append the desired hostname after HOSTNAME=
save your changes and reboot.

If you don't wish to reboot, then execute this command:
echo > /proc/sys/kernel/hostname
Jollyjet
Valued Contributor

Re: how to change the hostname?

hi refer this link which will help you

http://www.cpqlinux.com/hostname.html
Steven E. Protter
Exalted Contributor

Re: how to change the hostname?

Shalom,

Changing hostname in /etc/sysconfig/network may not require a reboot though recommended.

Making the change and doing a service network restart should be sufficient for most situations, short term.

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
Ivan Ferreira
Honored Contributor

Re: how to change the hostname?

For do it without reboot, edit /etc/sysconfig/network as menthioned above.

Run:

hostname "newhostname.domain"

Edit /etc/hosts to reflect the changes.

Update DNS servers if necessary.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?