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
HP-UX - Stunnel Configuration
Viewed 2193 times since Fri, Sep 28, 2018
How to mount software RAID1 member using mdadm
Viewed 2835 times since Wed, Oct 3, 2018
How log rotation works with logrotate
Viewed 4548 times since Fri, Nov 30, 2018
stunnel How To Encrypt Traffic to Redis with Stunnel on Ubuntu 16.04
Viewed 1816 times since Sun, Dec 6, 2020
LVM: Extend SWAP size by growing existing Logical Volume
Viewed 2259 times since Sat, Jun 2, 2018
HowTo: Retrieve Email from a POP3 Server using the Command Line
Viewed 9483 times since Mon, Feb 18, 2019
BIND for the Small LAN
Viewed 3160 times since Sun, May 20, 2018
How to encrypt a partition using LUKS?
Viewed 1614 times since Fri, Jul 13, 2018
Linux RAID Mdadm Cheat Sheet
Viewed 5139 times since Fri, May 15, 2020
Using stunnel to Encrypt Database Connections
Viewed 2732 times since Fri, Sep 28, 2018