Você está na página 1de 4

Setting the host name in the linux environment :-

To see the current hostname:- #hostname

linux environment :- To see the current hostname:- #hostname To set the Hostname on the fly

To set the Hostname on the fly

Command:- hostname <specify the hostname> Note :- This will be a temporary change to the host. Once the host is rebooted(Restarted) the name will be taken from /etc/sysconfig/network. Hence to make this persistent we have to modify the /etc/sysconfig/network file and make the changes.

After exection , To make the hostname persistant Modify #/etc/sysconfig/network Modify# /etc/hosts

After exection ,

After exection , To make the hostname persistant Modify #/etc/sysconfig/network Modify# /etc/hosts

To make the hostname persistant

Modify #/etc/sysconfig/network Modify# /etc/hosts

Modifying the #/etc/sysconfig/network file

Modifying the #/etc/sysconfig/network file After that edit /etc/hosts and make the changes accordingly as mentioned

After that edit /etc/hosts and make the changes accordingly as mentioned below.Do change the ipaddress according to your machine ip.

below.Do change the ipaddress according to your machine ip. Then restart the host to check if

Then restart the host to check if the name is persistent Command# init 6 or Command #reboot

For more info on the hostname command do #man hostname Regards Vadiraj Joish vadirajjr87@gmail.com

For more info on the hostname command do

#man hostname

Regards Vadiraj Joish

vadirajjr87@gmail.com