Click to See Complete Forum and Search --> : How do you change the hostname?


Trounce
11-02-2001, 02:35 PM
What is the definitive way of changing the hostname? I have RH 7.2, and i tried changing the hostname in the Network Config tool in RH, but that only brought problems: X wouldn't start, since it couldn't find the default hostname localhost.localdomain

I've done this before in 7.1, but can't remember which files i had to edit, but i know that i had to edit more than 1.
Can someone tell me which files they are?

Also, why is it that a.) even thought this process is not straightforward, there is no NHF or FAQ on this topic?
b.) Does anyone know if someone's working on a component to change the hostname in all the corresponding files?

mangeli
11-02-2001, 02:57 PM
Edit the /etc/hosts file.

I believe that does the trick.

The other thing you can do is type netconfig at the command line and reinput all the network info...

EyesWideOpen
11-02-2001, 04:14 PM
I think that there is another file in /etc (in addition to the one mangeli mentioned above). Maybe /etc/HOSTS or /etc/hostname? I'm not in Linux right now so I can't be sure.

Also you could try running the hostname command to change the hostname though that won't change it everywhere and I honestly don't even know what file(s) it changes. Try man hostname.

mangeli
11-02-2001, 04:15 PM
Yea, there is. Thanks EWO, its /etc/HOSTNAME you also need to edit this one.