How to Change a Hostname in Red Hat Enterprise Linux

How to Change a Hostname in Red Hat Enterprise Linux thumbnail
Red Hat Enterprise Linux is a widely used server OS.

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.

Instructions

    • 1

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

    • 2

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

    • 3

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

    • 4

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

    • 5

      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.

    • 6

      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.

    • 7

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

Related Searches

References

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

You May Also Like

Related Ads

Featured