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
tcpdump
Viewed 10440 times since Fri, Jul 27, 2018
OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu
Viewed 3641 times since Thu, May 24, 2018
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 4518 times since Sat, Jun 2, 2018
systemctl Use systemd to Start a Linux Service at Boot
Viewed 7078 times since Mon, Dec 7, 2020
Setup SSL Tunnel Using Stunnel on Ubuntu
Viewed 4113 times since Fri, Sep 28, 2018
rabbitmq Troubleshooting TLS-enabled Connections
Viewed 4062 times since Sun, Dec 6, 2020
RHCS6: Mirror/unmirror a GFS2 volume
Viewed 6183 times since Sun, Jun 3, 2018
Linux: Disks diagnostic using smartctl
Viewed 16416 times since Wed, Jul 25, 2018
RHEL: How to rebuild and/or patch a RPM package
Viewed 10581 times since Sat, Jun 2, 2018
How to convert RAW image to VDI and otherwise
Viewed 16324 times since Wed, Oct 3, 2018