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
Using IOzone for Linux disk performance analysis
Viewed 7188 times since Wed, Jul 25, 2018
Index » Community Contributions » System encryption using LUKS and GPG encrypted keys for arch linux
Viewed 2577 times since Fri, Jul 13, 2018
20 Practical Examples of RPM Commands in Linux rpm
Viewed 7563 times since Mon, Feb 18, 2019
How to stop and disable auditd on RHEL 7
Viewed 38377 times since Tue, Aug 6, 2019
O’Reilly’s CD bookshelf
Viewed 11385 times since Wed, Jun 27, 2018
RHCS6: Install a two-node basic cluster
Viewed 3140 times since Sun, Jun 3, 2018
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 3474 times since Fri, Nov 30, 2018
Fake A Hollywood Hacker Screen in Linux Terminal linux FUN
Viewed 4917 times since Thu, Apr 18, 2019
How To: Create Self-Signed Certificate – OpenSSL
Viewed 2675 times since Mon, Feb 18, 2019
Setup SSL Tunnel Using Stunnel on Ubuntu
Viewed 1983 times since Fri, Sep 28, 2018