[TriLUG] An easy one...

Jeremy P jeremyp at pobox.com
Thu May 2 14:40:21 EDT 2002


On Thu, 2 May 2002, Andrew Perrin wrote:

> On Thu, 2 May 2002, Chris Knowles wrote:
> 
> > OK, here's a question that has been tickling at the back of my head for some 
> > time.  
> > 
> > How do you change the hostname of a computer, permanently, from the 
> > command-line?  I know how to do it from the GUI, but how do you do it from 
> > the console?
> > 
> > See, wasn't that horribly easy?  Don't you think less of me now?

Many distributions have rc scripts that set it automatically, from a saved
config file.  If you run Red Hat Linux, the data is saved in
/etc/sysconfig/network Make sure you put the whole name there
(host.domain.ocm) not just the hostname part.

For that to become totally effective, you have to reboot, but you can
change the active hostname with the "hostname" command, but some
applications won't recognize the change until they're restarted.

--Jeremy




More information about the TriLUG mailing list