Normally we will set the hostname of a system during the installation process. but if we need to change hostname what can we do?
On any Linux system you can change its hostname with the command
[oracle@oel6 ~]$ hostname oel6 [oracle@oel6 ~]$ hostname aaa hostname: you must be root to change the host name [oracle@oel6 ~]$ su - Password: [root@oel6 ~]# hostname aaa [root@oel6 ~]# hostname aaa
This new name will be until the system rebooted. To permanent change in Red Hat base systems we need to change hostname in /etc/sysconfig/network file.
[root@oel6 ~]# vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=oel6
and change hostname in file.