How to change hostname in Redhat & Oracle Linux

As user “root”

“vi /etc/sysconfig/network”, change HOSTNAME value to the new hostname

“hostname NEW_HOST_NAME” to change it for the current sessions

“vi /etc/hosts”, change the old value to point to the new hostname

“service network restart” to restart the networking service and apply all the new changes

About SoCRaT

Software Engineer, OSS & Linux Geek
This entry was posted in Linux and tagged , , , , . Bookmark the permalink.

One Response to How to change hostname in Redhat & Oracle Linux

  1. There are no host names in /etc/hosts except localhost in default Oracle Linux installation. So /etc/sysconfig/network is enough

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s