Wednesday, 6 January 2016

Steps to change hostname




                            Step- by-step to change host name
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Command line method
=====================
1.#hostname
localhost.localdomain

2. login to root user

#su - root

3.#hostname  rac_node_1

4. Modify the host file /etc/hosts file

#vi /etc/hosts
127.0.0.1 rac_node_1 localhost.localdomain localhost4 localhost4.localdomain4

5. Modify the /etc/sysconfig/network file

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rac_node_1
GATEWAY=192.168.1.254

6. Restart network service.

# Service network restart

Own interface eth0:  Device state: 3 (disconnected)   [OK]
Shutting down interface eth1:  Device state: 3 (disconnected) [OK]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface eth1:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2 [  OK  ]
[root@rac_node_1 Packages]# service  network status
Configured devices:
lo eth0 eth1
Currently active devices:
lo eth0 eth1


6. [root@rac_node_1 tmp]# hostname
 rac_node_1









GUI   method
================

1. Login root user
 #su – root

2. Launch GUI interface

#system-config-network

i)



ii)

iii)


4. Restart service network

 #Service network restart

Own interface eth0:  Device state: 3 (disconnected)   [OK]
Shutting down interface eth1:  Device state: 3 (disconnected) [OK]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface eth1:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2 [  OK  ]
[root@rac_node_1 Packages]# service  network status
Configured devices:
lo eth0 eth1
Currently active devices:
lo eth0 eth1


5. [root@rac_node_1 tmp]# hostname
 rac_node_1

No comments:

Post a Comment