To change host name you must have root access of the system. We can do it using any text editor, here I am using text editor "vim".
Open /etc/sysconfig/network file.
[root@lmntechnohub ~]# vim /etc/sysconfig/network
Modify the HOSTNAME= value, and set your new host name.
HOSTNAME=lmntechnohub.com
For internal networking, change the entries in host files at /etc/hosts .
127.0.0.1 localhost localhost.localdomain
10.10.10.10 lmntechnohub.com
Run the host-name command. This command will change host-name of Linux server, but it will not immediately update all programs that are running with old host-name.
[root@lmntechnohub ~]# hostname lmntechnohub.com
[root@lmntechnohub ~]# hostname
lmntechnohub.com
[root@lmntechnohub ~]#
To finalize it restart network service on your system, to ensure that changes will there on system restart.
[root@lmntechnohub ~]# /etc/init.d/network restart
ENJOY! and Stay connected.
0 comments :
Post a Comment