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
RHEL: Crash kernel dumps configuration and analysis on RHEL 6
Viewed 4631 times since Sat, Jun 2, 2018
Monitoring bezpieczeństwa Linux: integracja auditd + OSSEC cz. I
Viewed 2364 times since Fri, Apr 5, 2019
ZFS: Grow/Shrink an existing zfs filesystem
Viewed 6201 times since Sun, Jun 3, 2018
RHEL: Back-up/Replicate a partition table
Viewed 3288 times since Sun, May 27, 2018
Secure Secure Shell
Viewed 10605 times since Fri, Aug 21, 2020
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 1815 times since Mon, Feb 18, 2019
logrotate - rotates, compresses, and mails system logs.
Viewed 1658 times since Fri, Nov 30, 2018
RHEL: Display swap/RAM size
Viewed 3187 times since Sat, Jun 2, 2018
How to mount software RAID1 member using mdadm
Viewed 2955 times since Wed, Oct 3, 2018
How to accurately determine when the system was booted
Viewed 2236 times since Wed, Oct 3, 2018