This is post for those who are new to Red Hat Linux or Oracle Enterprise Linux (OEL) and wish to change hostname .
How to find hostname on Linux/OEL ?
Use command “hostname” to find host name of Linux
How to change hostname on Linux/OEL ?
- Open file /etc/sysconfig/network using editor like vi , nano or ed
- Change entry HOSTNAME=XXXXXX to
HOSTNAME=New_Host_Name
- Restart xinetd service or reboot Linux/OEL
Restart xinetd service xinetd restart
Reboot Linux reboot
- If you have defined hostname resolution in hosts file then change entry in /etc/hosts