Dave's Brain

Browse - Computer Tips - How do I change the computer name of my RedHat/Fedora/CentOS box?

Date: 2007nov19
OS: Linux
Distro: RedHat/Fedora/CentOS
Keywords: hostname, computer name, reboot

Q.  How do I change the computer name of my RedHat/Fedora/CentOS 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-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.