- See hostname
hostname
ORsysctl kernel.hostname
-
Set the new hostname
hostname NEW_HOSTNAME
ORsysctl kernel.hostname=NEW_HOSTNAME
- Permanent change
- on Ubuntu and any others based on Debian
vi /etc/hostname
replace OLD_HOSTNAME with NEW_HOSTNAMEservice hostname start
- on CentOS and any others based on Redhat
vi /etc/sysconfig/network
replace HOSTNAME="OLD_HOSTNAME" with NEW_HOSTNAME/etc/rc.d/rc.sysinit
- on Ubuntu and any others based on Debian
No comments:
Post a Comment