LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   changing localhost (https://www.linuxquestions.org/questions/linux-software-2/changing-localhost-59955/)

endfx 05-15-2003 01:27 PM

changing localhost
 
I'm confused on how to change the name of my machine from localhost. when I type "hostname testmachine" it changes the name to testmachine, but when I reboot, the name is changed back to localhost
I have edited the /etc/hosts file, but this doesn't seem to do anything.
Can anybody tell me how to change the name of my machine to something else (ie so the prompt reads:
[endfx@testmachine /]$ )
Thanks

manthram 05-15-2003 02:05 PM

put you host name in the file '/etc/hostname'

and please use the search before you post a question.

endfx 05-15-2003 03:27 PM

sorry, I should have mentioned this above
I don't have the file /etc/hostname
Thats whats confusing me. It seems to be getting the hostname from somewhere else everytime I boot.
As mentioned above I changed /etc/hosts and used the hostname command to change it, neither of which seem to be working. I'm using mandrake9.1
Am I missing something very simple here? thanks

david_ross 05-15-2003 03:37 PM

Try using:
hostname yourhost.com

cyberskye 05-15-2003 04:14 PM

Put the desired hostname in front of localhost.domain localhost in /etc/hosts. I believe that should do it.

Quote:

I'm confused on how to change the name of my machine from localhost
You don't really want to remove localhost - there's software that needs it.

Skye

manthram 05-15-2003 05:23 PM

create a the file '/etc/hostname' network will see if the file is there. if it is it will read form there.

or you can put the line below in the file '/etc/sysconfig/network'

HOSTNAME=yourhostname

endfx 05-15-2003 05:27 PM

Thanks, thats what I needed
I added the line HOSTNAME=whatever to /etc/sysconfig/network
that worked, thx


All times are GMT -5. The time now is 02:30 AM.