LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2008, 05:10 AM   #1
yusufs
Member
 
Registered: Oct 2007
Posts: 162

Rep: Reputation: 30
Changing hostname


Hai all,

We are using RHEL ES 4.0 Update 6

We have a network of 35 Linux servers, (with no domain installation)..Currently there is a requirement that one server name has to be changed as follows :

linux.nodomain.com to apps.domain.com..

Where do I have to change this ?.. How can I make sure that there are no traces of the old hostname remains in the server..Do I have to reboot the server ?

Please advise


Yusuf
 
Old 10-16-2008, 05:31 AM   #2
bhajan.verma
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Rep: Reputation: 0
you can change hostname in file /etc/sysconfig/network also in /etc/hosts

then reboot the system.
 
Old 10-16-2008, 05:32 AM   #3
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
Hi yusufs

If you edit the /etc/hosts file should be enough

Angel.

Last edited by angel115; 10-16-2008 at 05:45 AM.
 
Old 10-16-2008, 05:47 AM   #4
yusufs
Member
 
Registered: Oct 2007
Posts: 162

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by angel115 View Post
Hi yusufs

If you edit the /etc/hosts file should be enough

Angel.


Thanks Friends,

Will do and let you know if there is any problem


Yusuf
 
Old 10-16-2008, 06:08 AM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You will need to change /etc/sysconfig/network in redhat. Don't forget to restart the network services once changed
 
Old 10-16-2008, 08:26 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
I usually run through this guide to make sure everything is set properly and returns the correct hostname.

http://www.cpqlinux.com/hostname.html
 
Old 10-16-2008, 08:33 AM   #7
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
Hi billymayday,

I've just done the test on Readhat 4
After editing the file /etc/sysconfig/network, and restarting the network service doesn't seems to be enough.

After a reboot the changes are done but it should be an other way to apply the change without restarting.

Here is what I've tried and doesn't work:
Code:
service network restart
service network reload
Ifconfig eth0 down && Ifconfig eth0 up
xinetd restart
The above have no effect and the hostname stay unchanged.
 
Old 10-16-2008, 03:22 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I use 5, so may be different.

Do you havea utility called "system-config-network" installed?
 
Old 10-16-2008, 11:21 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
I believe this section of the link I posted previously would have made the switch without the reboot..

Quote:
Checking /proc/sys/kernel/hostname
This is checked with the following command:

cat /proc/sys/kernel/hostname

If you need to set this file, you can either reboot or set it now with the following command:

echo mybox.mydomain.com > /proc/sys/kernel/hostname
shouldn't skip over them provided links
 
Old 10-17-2008, 12:27 AM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Actually using the hostname command would probably achieve the same.
 
Old 10-17-2008, 01:56 AM   #11
bhajan.verma
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Rep: Reputation: 0
to chnage host name without reboot u can use echo "hostname" > /proc/sys/kernel/hostname.

hostname command only work for current open shell.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing hostname arnuld Fedora 8 12-13-2007 06:28 AM
hostname changing rusty_slacker Linux - General 2 04-15-2005 07:49 PM
Changing hostname? Alf829 Linux - Networking 2 03-08-2004 09:31 AM
Changing the hostname. KrazyKid Slackware 6 06-30-2002 10:56 PM
changing hostname glock19 Linux - Networking 3 02-01-2002 10:26 PM


All times are GMT -5. The time now is 08:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration