[Level 1] Change Hostname in CentOS.

How to change hostname in CentOS.
1. Changing online server hostname.
Use command "hostname".
ex.
  # hostname my_new_hostname.my_new_domainname;

2. Changing hostname permanently.
  a. change setting "HOSTNAME" of file /etc/sysconfig/network
ex.
  HOSTNAME=my_new_hostname.my_new_domainname

  b. use command "sysctl"
ex.
  # sysctl kernel.hostname=\
my_new_hostname.my_new_domainname;


Wish this helps.

regards,
Stanley Huang

Comments

Popular posts from this blog

[Level 2] Shell Interactive With Zenity Episode 5 -- list

[Level 2] iif in Python