RHEL: Change system’s hostname
Article Number: 73 | Rating: Unrated | Last Updated: Sun, May 27, 2018 8:55 PM
# 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