Dave's Brain

Browse - computer tips - linux change hostname

Date: 2007nov19
OS: Linux
Keywords: hostname, computer name, reboot

Q.  How do I change the computer name of my Fedora/Red Hat box?

A.  As root do this command:

	hostname NEWNAME

Where NEWNAME is the new name.
That will change the name for now but it will be reset when you
reboot.  So also change:

File /etc/sysconfig/networking/profiles/default/network to read:

	HOSTNAME=NEWNAME

Older Red Hat's used to use file /etc/HOSTNAME.  They did:

	hostname `cat /etc/HOSTNAME`

at boot.

If you want to use a GUI, this is it:

	system-config-network

its in the DNS tab.

You'll probably want to check for the old hostname in your Apache and Postfix
configuation files.

Add a comment

Sign in to add a comment
Copyright © 2008, dave - Code on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License.