LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-14-2003, 06:40 AM   #1
wiredX
Member
 
Registered: Jul 2003
Distribution: Redhat 8.0
Posts: 38

Rep: Reputation: 15
setting up hostname in RH9


Hello

Im trying to setup a hostname of RH 9 and everytime I set it up it gets reseted back to localhost.localdoamain.

I used the "hostname" command to set it up.

ANy help appreciated

thnx.
 
Old 07-14-2003, 07:14 AM   #2
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
You must also edit /etc/hosts file.
 
Old 07-14-2003, 07:27 AM   #3
seabass55
Member
 
Registered: Jan 2003
Location: 127.0.0.1
Distribution: Fedora&Gentoo
Posts: 207

Rep: Reputation: 30
No

vi /etc/sysconfig/network

Set it in there

Seabass
 
Old 07-14-2003, 08:06 AM   #4
wiredX
Member
 
Registered: Jul 2003
Distribution: Redhat 8.0
Posts: 38

Original Poster
Rep: Reputation: 15
I edited the /etc/hosts
added my hostname on the same line as the localhost

And it Works!

thnx y'all
 
Old 07-14-2003, 01:44 PM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
I agree with Seabass, adding it to /etc/hosts will work,
but it is better to add it to /etc/sysconfig/network.
Add a line: HOSTNAME=<my_hostname>
 
Old 07-15-2003, 03:03 AM   #6
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
Is /etc/sysconfig/network a RH specific file ??
Becouse I use Slackware and the only file that contains my hostname is /ect/HOSTNAME (of course) and /etc/hosts. (Well there is also /etc/resolv.conf - but that is a different story).

Thank you

Last edited by lfur; 07-15-2003 at 03:08 AM.
 
Old 07-15-2003, 08:34 AM   #7
wiredX
Member
 
Registered: Jul 2003
Distribution: Redhat 8.0
Posts: 38

Original Poster
Rep: Reputation: 15
I actually found out that adding the hostname to /etc/hosts doesn,t set the hostname properly.After restarting the hostname gets resetted back localhost.localdomain.Thats because in /etc/sysconfig ,the line for hostname says localhost.localdomain.

So I added the hostname to /etc/sysconfig/network

and added it to the /etc/hosts

Even after restarting the machine the hostname stays the same...

I wanna thank y'all for helping!
 
Old 07-15-2003, 08:58 AM   #8
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Reply concerning lfur's question

Yes.

/etc/sysconfig/network is RedHat specific and I believe Mandrake also. I could be mistaken.

Anyways, I took me a while to figure that one out.
 
Old 07-15-2003, 09:35 AM   #9
seabass55
Member
 
Registered: Jan 2003
Location: 127.0.0.1
Distribution: Fedora&Gentoo
Posts: 207

Rep: Reputation: 30
Madrake does it differently I believe.

Oh and...I told you it would work :-P
 
Old 07-15-2003, 10:46 AM   #10
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
I know it does.
I agreed with you in an earlier post, remember ?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Hostname abhijeetudas Linux - Networking 1 06-04-2005 07:10 AM
setting up my hostname lawkh Linux - Newbie 3 01-23-2004 04:22 PM
setting hostname akamol Linux - General 2 07-03-2003 03:48 AM
setting hostname skunk1 Solaris / OpenSolaris 3 04-02-2003 01:00 AM
setting up a hostname sakeeb Linux - Networking 3 04-28-2002 04:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:41 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
Open Source Consulting | Domain Registration