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
There are no host names in /etc/hosts except localhost in default Oracle Linux installation. So /etc/sysconfig/network is enough
I login as root and “vi /etc/sysconfig/network ” but it doesn’t show the hostname after I restart. it show none. Please help in this.