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
ZPOOL: Grow a zpool by adding new device(s)
Viewed 6278 times since Sun, Jun 3, 2018
Linux Health Check Commands
Viewed 3430 times since Fri, Jun 8, 2018
Linux Chage Command to Set Password Aging for User
Viewed 2662 times since Tue, Sep 11, 2018
RHEL: Handling SCSI disks
Viewed 12783 times since Sun, May 27, 2018
Logowanie za pomocą kluczy Secure Shell
Viewed 3159 times since Thu, May 24, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 3797 times since Mon, Jan 28, 2019
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 4042 times since Fri, Nov 30, 2018
Top 20 OpenSSH Server Best Security Practices - good article
Viewed 10916 times since Mon, Oct 1, 2018
RHEL: How to rebuild and/or patch a RPM package
Viewed 9056 times since Sat, Jun 2, 2018
RHEL: XFS basic operations
Viewed 16315 times since Sat, Jun 2, 2018