LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Changing from localhost? (https://www.linuxquestions.org/questions/mandriva-30/changing-from-localhost-381249/)

purelithium 11-08-2005 05:29 PM

Changing from localhost?
 
I know this might seem like a pretty newb-ish question but how do I change my hostname permanently, I know how to change it temporarily with the hostname command, but I want it to stay that name even when I reboot.

Any help?

mebrelith 11-08-2005 05:59 PM

Edit /etc/hosts.

Copy the line that says
Code:

127.0.0.1              localhost.localdomain localhost
immediately below and change the last localhost for whatever you want to name your computer. At the end you should have something like this:
Code:

127.0.0.1              localhost.localdomain localhost
127.0.0.1              localhost.localdomain MyLinuxBox

where MyLinuxBox can be whatever you choose.

Then edit /etc/sysconfig/network, comment out the HOSTNAME line and type a new
Code:

HOSTNAME=MyLinuxBox
where MyLinuxBox is whatever you typed in /etc/hosts. At the end it should look something like this:
Code:

NETWORKING=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=MyLinuxBox

Reboot your box
Good luck

purelithium 11-08-2005 07:43 PM

Excellent!

I knew the network file was there, but didn't know to edit the hosts file.

Thank you.

mebrelith 11-08-2005 07:52 PM

No problema. Thats what we are here for.


All times are GMT -5. The time now is 11:59 AM.