hostname
hostname -f
To change the host name on CentOS 6,
- sudo vi /etc/sysconfig/network
- Update HOSTNAME=[hostname.domain.com] to match the FQDN.
- For example,
- HOSTNAME=cent6.contoso.edu
- :wq
- If necessary, update /etc/hosts file for internal networking. Change the host that is associated with the IP address.
- sudo vi /etc/hosts
- change the host name as needed.
- Run the hostname command to change the hostname on the server. For example,
- sudo hostname cent6.contoso.edu
- Restart network
- sudo /etc/init.d/network restart
No comments:
Post a Comment