RHEL: Change system’s hostname


# Tested on RHEL 5, 6 & 7


# RHEL 5 & 6 -------------------------------------------------------------------------------

# Change hostname in /etc/sysconfig/network file

# and run following command:

hostname <new_hostname>

# Do not forget to update /etc/hosts if necessary



# RHEL 7 -----------------------------------------------------------------------------------

# Run following command:

hostnamectl set-hostname <new_hostname>

# OR change hostname in /etc/hostname, for permanent change, and run following command:

hostname <new_hostname>

# Do not forget to update /etc/hosts if necessary

 


Article Number: 73
Posted: Sun, May 27, 2018 8:55 PM
Last Updated: Sun, May 27, 2018 8:55 PM

Online URL: http://kb.ictbanking.net/article.php?id=73