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

 
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 7
Viewed 4187 times since Mon, Oct 29, 2018
RHCS6: Reduce a Global Filesystem 2 (GFS2)
Viewed 4136 times since Sun, Jun 3, 2018
How to use yum command on CentOS/RHEL
Viewed 12112 times since Wed, Oct 17, 2018
Przekazywanie portów TCP rinetd
Viewed 46784 times since Thu, May 24, 2018
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 4723 times since Fri, Nov 30, 2018
Monitoring bezpieczeństwa Linux: integracja auditd + OSSEC cz. I
Viewed 3240 times since Fri, Apr 5, 2019
RHEL: ACLs basics
Viewed 7545 times since Sun, May 27, 2018
how to list all hard disks in linux from command line
Viewed 5397 times since Mon, Jan 28, 2019
Use inotify-tools on CentOS 7 or RHEL 7 to watch files and directories for events
Viewed 15255 times since Fri, Jul 27, 2018
LVM: Extend SWAP size by growing existing Logical Volume
Viewed 3295 times since Sat, Jun 2, 2018