How to Change a Hostname in Red Hat Enterprise Linux


Red Hat Enterprise Linux, also called CentOS, is a distribution of the Linux kernel with additional software packages added in to suit general business server needs. Like all Linuxes, it uses the standard Unix commands, including the ones for changing a hostname on the local network. Hostnames are used to identify computers on networks in human-readable formats, and are concatenated into domain names when the computer itself is visible on the Internet. Hostnames are also changed as part of co-location and hosting packages.

  • Start the terminal application in order to get command-line access to your chosen shell.

  • Determine your current hostname by typing "hostname", and then pressing "Enter." Your terminal window shows the current hostname of your computer.

  • Change the current hostname to the new hostname by typing "hostname <newname>", replacing "newname" with the replacement hostname.

  • Confirm that the hostname has been changed by typing "hostname" by itself.

  • Change directories to /etc/ and open the "hosts" file. Within this file, change the machine's name -- it's right after the IP address -- to the new hostname, and then save the file.

  • Change directories to /etc/sysconfig/ and open the "network" file. Change the HOSTNAME parameter in this file to your new hostname, and then save the file.

  • Restart the network by typing "service network restart" from the command line.

Related Searches


  • Photo Credit Frédérick Lefebvre/iStock/Getty Images
Promoted By Zergnet


You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!