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
Top 20 OpenSSH Server Best Security Practices - good article
Viewed 12117 times since Mon, Oct 1, 2018
How to use yum command on CentOS/RHEL
Viewed 12361 times since Wed, Oct 17, 2018
Używanie rsync poprzez Secure Shell
Viewed 42086 times since Thu, May 24, 2018
Jak znaleźć najszybszy publiczny serwer DNS w Polsce?
Viewed 3893 times since Mon, May 21, 2018
SSH: Execute Remote Command or Script – Linux
Viewed 3164 times since Mon, Feb 18, 2019
Secure Secure Shell
Viewed 13097 times since Fri, Aug 21, 2020
How to configure an SSH proxy server with Squid
Viewed 4419 times since Sun, Dec 6, 2020
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 3617 times since Fri, Sep 28, 2018
Enabling automatic updates in Centos 7 and RHEL 7
Viewed 3367 times since Wed, Oct 17, 2018
How To Use Systemctl to Manage Systemd Services and Units
Viewed 8500 times since Mon, Dec 7, 2020