Tuesday 8 July 2014

How to change the hostname on Oracle Enterprise Linux 6

How to change the hostname on Oracle Enterprise Linux 6?

If you want to change the hostname of the server, then edit the below two files

/etc/sysconfig/network
/etc/hosts

Lets take the example that we want to change the hostname "myserver001" to "hostserver001"
#vi /etc/sysconfig/network

HOSTNAME=myserver001
NETWORKING=yes
GATEWAY=172.21.110.54
NETWORKING_IPV6=no
IPV6INIT=no
NOZEROCONF=yes

After change

HOSTNAME=hostserver001
NETWORKING=yes
GATEWAY=172.21.110.54
NETWORKING_IPV6=no
IPV6INIT=no
NOZEROCONF=yes

Then update the /etc/hosts file
172.21.110.160          myserver001

After change


172.21.110.160           hostserver001


Now reboot the server..Your new name is assigned to the host.