[SWLUG] Hostname

Justin Mitchell justin at discordia.org.uk
Mon May 27 09:31:21 UTC 2002

On 26 May, Neil Jones wrote:
> This is irritating since I have something which depends on this being right.
> Every time I switch my machine on the Hostname setting reverts to localhost.
> I have set it to the value I want on a few occasions but rebooting resets it.
> I presume somewhere in the boot settings there is something which is either 
> doing this or the absence of something leads to the insertion of a default.
> I want to change this to a valid value and keep it changed. How do I do it?

Exactly what sets the hostname is going to depend on which version of
which linux dist your using, and also if you have a network card
configured properly.

If its a recent redhat then the hostname should get set from the
HOSTNAME value in /etc/sysconfig/network. You should also check that the
values in /etc/hosts look sane.

To be sure exactly what is setting your hostname, and clues as to what
to do to make it set it differently, search through your
/etc/rc.d/ directory for mentions of the 'hostname' command, which is
used to both print, and set the current hostname.

If it is always coming up as localhost then i would assume that you have
no network cards configured, or have somehow missed a chunk of the


More information about the Swlug mailing list