Você está na página 1de 4

How to Change HostName and IP-Address in CentOS / RedHat Linux

Setting the host name in the linux environment :To see the current hostname:- #hostname

To set the Hostname on the fly Command:- hostname <specify the hostname> Note :- This ill !e a temporary change to the host" #nce the host is re!ooted$%estarted& the name ill !e ta'en from (etc(sysconfig(net or'" Hence to ma'e this persistent e have to modify the (etc(sysconfig(net or' file and ma'e the changes"

)fter exection *

To ma'e the hostname persistant +odify #(etc(sysconfig(net or' +odify# (etc(hosts

+odifying the #(etc(sysconfig(net or' file

)fter that edit (etc(hosts and ma'e the changes accordingly as mentioned !elo ",o change the ipaddress according to your machine ip"

Then restart the host to chec' if the name is persistent Command# init or Command #re!oot

.or more info on the hostname command do #man hostname %egards /adira0 1oish vadira00r234gmail"com

Você também pode gostar