LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   setting up hostname in RH9 (https://www.linuxquestions.org/questions/linux-general-1/setting-up-hostname-in-rh9-72559/)

wiredX 07-14-2003 06:40 AM

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.

lfur 07-14-2003 07:14 AM

You must also edit /etc/hosts file.

seabass55 07-14-2003 07:27 AM

No

vi /etc/sysconfig/network

Set it in there

Seabass

wiredX 07-14-2003 08:06 AM

I edited the /etc/hosts
added my hostname on the same line as the localhost

And it Works!

thnx y'all

Mathieu 07-14-2003 01:44 PM

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>

lfur 07-15-2003 03:03 AM

Is /etc/sysconfig/network a RH specific file ?? :scratch:
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

wiredX 07-15-2003 08:34 AM

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!

Mathieu 07-15-2003 08:58 AM

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.

seabass55 07-15-2003 09:35 AM

Madrake does it differently I believe.

Oh and...I told you it would work :-P

Mathieu 07-15-2003 10:46 AM

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


All times are GMT -5. The time now is 09:49 PM.