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
RHCS6: Luci - the cluster management console
Viewed 1721 times since Sun, Jun 3, 2018
ZFS: Remove an existing zfs filesystem
Viewed 970 times since Sun, Jun 3, 2018
Fix rpmdb: Thread died in Berkeley DB library
Viewed 19112 times since Fri, Feb 14, 2020
Linux Kernel /etc/sysctl.conf Security Hardening
Viewed 21579 times since Fri, Aug 3, 2018
How to sort IP addresses in Linux
Viewed 2190 times since Sun, May 20, 2018
Linux File Systems (mkfs, mount, fstab) ext4
Viewed 1469 times since Sat, Jun 2, 2018
Build a simple RPM that packages a single file
Viewed 5489 times since Sat, Jun 2, 2018
RHEL: XFS basic operations
Viewed 12952 times since Sat, Jun 2, 2018
Prosty skaner portów TCP w bash
Viewed 1658 times since Thu, May 24, 2018
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 1539 times since Sat, Jun 2, 2018