LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do you change your hostname? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-change-your-hostname-346128/)

Thaidog 07-23-2005 11:34 PM

How do you change your hostname?
 
I went to my commandline to change my host name with su with cmd: hostname newlocalhostname

This changed it but when I reboot I get my same old localhost hostname... can you tell me what I'm doing wrong?

johnson_steve 07-24-2005 12:20 AM

try this (as root)

echo "new_host_name" > /etc/hostname

Xihuitl 07-24-2005 12:20 AM

Which distro and version are you using? Be sure to check the online docs for that distrobution and it should tell you how to set your hostname, as that is very basic stuff on a linux box (Shouldn't it be manditory??)

Thaidog 07-24-2005 12:43 AM

I'm using Turbo Linux 10F

aikidoist72 07-24-2005 01:07 AM

All good suggestions above :)

As root

Code:

# hostname (new hostname)
cheers

tkedwards 07-24-2005 08:36 PM

Quote:

hostname (new hostname)
This change will not stay after a reboot, which is his original problem. On many distros you have to change it in the file /etc/sysconfig/network, so if you have a directory /etc/sysconfig/ already there then thats likely how you have to do it. Add a line to the file 'HOSTNAME=myhostname' (without the quotes).

aikidoist72 07-24-2005 08:52 PM

What does your /etc/hostname file say?


All times are GMT -5. The time now is 09:41 AM.