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
How to find the largest files and directories in Linux?
Viewed 4250 times since Sun, May 20, 2018
Top 10 darmowych i publicznych serwerów DNS
Viewed 3116 times since Tue, May 22, 2018
linux manual tools
Viewed 3730 times since Fri, Sep 28, 2018
Increase A VMware Disk Size (VMDK) Formatted As Linux LVM without rebooting
Viewed 17106 times since Wed, May 30, 2018
Creating SWAP partition using FDISK & FALLOCATE commands
Viewed 8308 times since Thu, Jan 16, 2020
Odpalenie polecenia tylko na jedną godzinę
Viewed 3617 times since Thu, May 24, 2018
Turbocharge PuTTY with 12 Powerful Add-Ons – Software for Geeks #3
Viewed 16122 times since Sun, Sep 30, 2018
Securing /tmp and shm partitions
Viewed 4331 times since Fri, May 15, 2020
PROCESSOR AND MEMORY INFORMATION
Viewed 6994 times since Sat, Jun 2, 2018
Deskshare TLS over Stunnel
Viewed 3633 times since Fri, Sep 28, 2018