how to change hostname in linux
Very often you might want to change the hostname in your linux server. The hostnames are usually written like…
vps.domain.com
server.domain.com
box.domain.com
web.domain.com
and it is a very good idea to follow this hostname format.
To change hostname all you have to do is modify 2 files
1. Open /etc/hosts and change the name of the host
127.0.0.1 vps.domain.com vps localhost localhost.localdomain
2. Open /etc/sysconfig/network and do the change
HOSTNAME="vps.domain.com"
Once this is done, check whether the hostname has been changed using hostname command after restart.
Thats all!
Similar Posts:
- Difference between /etc/hosts and /etc/hostname
- How to upload/download files with FTP in linux commandline
- How to secure your DNS server
- How to install a local copy and configure WordPress on Ubuntu
- Setup Postfix/Dovecot MailServer for Centos/RHEL
- Registering DNS Nameserver with Godaddy
- EASY way to install Zend Optimizer in Cpanel
- Domain with WWW not resolving problem!
- What is Open DNS server?
- Enabling ModRewrite in XAMPP Apache


April 17, 2010
WHM has a tool for this. Much easier. I couldn’t figure it out after taking those steps… Host name still shows my vps#.host.com