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
Securing /tmp and shm partitions
Viewed 3498 times since Fri, May 15, 2020
logrotate Log Rotate Configuration
Viewed 3395 times since Sun, Jan 12, 2020
Learn Linux System Auditing with Auditd Tool on CentOS/RHEL
Viewed 4603 times since Fri, Apr 5, 2019
Using Official Redhat DVD as repository
Viewed 11423 times since Mon, Oct 29, 2018
RHCS6: Reduce a Global Filesystem 2 (GFS2)
Viewed 3611 times since Sun, Jun 3, 2018
RHCS6: Mirror/unmirror a GFS2 volume
Viewed 5447 times since Sun, Jun 3, 2018
RHCS6: Debug and test multicast traffic between two hosts
Viewed 6927 times since Sun, Jun 3, 2018
ZFS: Remove an existing zfs filesystem
Viewed 2317 times since Sun, Jun 3, 2018
ZFS: Verify/change properties of a zfs filesystem
Viewed 2816 times since Sun, Jun 3, 2018
RHCS6: Show/Add GFS2/GFS journals
Viewed 12938 times since Sun, Jun 3, 2018