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
Linux – How to check the exit status of several piped commands
Viewed 1151 times since Wed, Jul 25, 2018
How To Create a Linux Swap File
Viewed 603 times since Fri, Jun 8, 2018
RHCS6: Basic operations on clustered services
Viewed 689 times since Sun, Jun 3, 2018
Stunnel Setup
Viewed 3056 times since Fri, Sep 28, 2018
Split and Reassemble files
Viewed 883 times since Mon, May 28, 2018
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 556 times since Mon, Feb 18, 2019
Jak wygenerować silne hasła jednorazowe w Linuksie?
Viewed 835 times since Thu, May 24, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 7
Viewed 1071 times since Sat, Jun 2, 2018
RHEL: GPT/MBR partition tables (using disks larger than 2 TiB)
Viewed 957 times since Sun, May 27, 2018
RHEL: Force system to prompt for password in Single User mode
Viewed 1356 times since Sat, Jun 2, 2018