System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to safely change hostname in RHEL5

SOLVED
Go to solution
Yaboto
Super Advisor

How to safely change hostname in RHEL5


What is the recommended way to change the system name or hostname of RHEL5 server.

Regards,
4 REPLIES
Matti_Kurkela
Honored Contributor
Solution

Re: How to safely change hostname in RHEL5

Use "system-config-network".

If you have DISPLAY environment variable set and the GUI version of the utility installed, it will display a X window with tabs for various network settings. The hostname is on the DNS tab.

If DISPLAY is not set or you have only the text version installed, it will display a text-based window. Select "Edit DNS settings" and there you'll find the hostname.

You can even make the change manually. There are only two places to change: the HOSTNAME= setting in /etc/sysconfig/network and the line that corresponds to your system in /etc/hosts. Reboot after the change.

MK
MK
Yaboto
Super Advisor

Re: How to safely change hostname in RHEL5


Please,
what about /etc/hosts ?
, since the host can't ping itself.
Steven E. Protter
Exalted Contributor

Re: How to safely change hostname in RHEL5

Shalom,

vi /etc/sysconfig/network

Change host name

Save.

Make sure /etc/hosts is consistent with the new hostname for faster local name resolution.

service network restart

Reboot the box at a convenient time.

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
Yaboto
Super Advisor

Re: How to safely change hostname in RHEL5


Thanks !