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
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
10-16-2008, 04:10 AM
#1
Member
Registered: Oct 2007
Posts: 162
Rep:
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
10-16-2008, 04:31 AM
#2
LQ Newbie
Registered: Jul 2006
Posts: 14
Rep:
you can change hostname in file /etc/sysconfig/network also in /etc/hosts
then reboot the system.
10-16-2008, 04:32 AM
#3
Member
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 450
Rep:
Hi yusufs
If you edit the /etc/hosts file should be enough
Angel.
Last edited by angel115; 10-16-2008 at 04:45 AM .
10-16-2008, 04:47 AM
#4
Member
Registered: Oct 2007
Posts: 162
Original Poster
Rep:
Quote:
Originally Posted by
angel115
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
10-16-2008, 05:08 AM
#5
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
You will need to change /etc/sysconfig/network in redhat. Don't forget to restart the network services once changed
10-16-2008, 07:26 AM
#6
Guru
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,230
Rep:
I usually run through this guide to make sure everything is set properly and returns the correct hostname.
http://www.cpqlinux.com/hostname.html
10-16-2008, 07:33 AM
#7
Member
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 450
Rep:
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.
10-16-2008, 02:22 PM
#8
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
I use 5, so may be different.
Do you havea utility called "system-config-network" installed?
10-16-2008, 10:21 PM
#9
Guru
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,230
Rep:
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
10-16-2008, 11:27 PM
#10
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
Actually using the hostname command would probably achieve the same.
10-17-2008, 12:56 AM
#11
LQ Newbie
Registered: Jul 2006
Posts: 14
Rep:
to chnage host name without reboot u can use echo "hostname" > /proc/sys/kernel/hostname.
hostname command only work for current open shell.
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 09:17 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News