Change hostname | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

Change hostname

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-14-2007
madmat madmat is offline
Registered User
 
Join Date: Aug 2005
Last Activity: 17 December 2013, 9:47 AM EST
Location: Paris
Posts: 97
Thanks: 0
Thanked 1 Time in 1 Post
Question Change hostname

Hello,

I would like to change the hostname on a Linux server (RHEL4).
I try different methods in vain :
- by using hostname command
- by changing /etc/hosts and /etc/hostname

But after restarting server, the old hostname re-appears...
And the file ./proc/sys/kernel/hostname contains again the old value (however modified after hostname command)

Any idea ?
Sponsored Links
    #2  
Old 09-14-2007
madmat madmat is offline
Registered User
 
Join Date: Aug 2005
Last Activity: 17 December 2013, 9:47 AM EST
Location: Paris
Posts: 97
Thanks: 0
Thanked 1 Time in 1 Post
Correction : OS version is RHEL 2.1
Sponsored Links
    #3  
Old 09-19-2007
mr_manny mr_manny is offline
Registered User
 
Join Date: Oct 2005
Last Activity: 15 November 2013, 4:46 PM EST
Posts: 154
Thanks: 1
Thanked 2 Times in 2 Posts
check under /etc/sysconfig

[root@myBOX etc]# cd /etc/sysconfig/

[root@myBOX sysconfig]# grep myBOX *
network:HOSTNAME=myBOX.domain.com
    #4  
Old 09-20-2007
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
 
Join Date: Nov 2006
Last Activity: 20 November 2013, 8:29 AM EST
Location: Bulgaria
Posts: 1,419
Thanks: 0
Thanked 6 Times in 6 Posts
Here is a quote from the net :
Quote:
RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot. This is set using the init script /etc/rc.d/rc.sysinit
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=”plain.domainname.com”
GATEWAY=”192.168.0.1″
GATEWAYDEV=”eth0″
FORWARD_IPV4=”yes”

So in order to preserve your change on system reboot edit this file and enter the appropriate name using the HOSTNAME variable.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
change IP and hostname in red hat ES 5 chuikingman Red Hat 2 07-20-2011 09:28 AM
Change HostName nalina UNIX for Dummies Questions & Answers 9 03-25-2008 06:41 AM
Solaris - unknown hostname - how can I change hostname? XNOR UNIX for Dummies Questions & Answers 1 03-29-2007 10:52 PM
change hostname fishman2001 UNIX for Dummies Questions & Answers 2 01-12-2006 08:39 AM
change hostname fishman2001 UNIX for Dummies Questions & Answers 9 10-21-2002 09:07 AM



All times are GMT -4. The time now is 10:17 PM.