How To Change Your Linux Server’s Hostname

April 21st, 2008 · No Comments

To change your server’s hostname manually on CentOS / RHEL is quite easy. Simply edit the file /etc/sysconfig/network with your favorite text editor and change the value of the HOSTNAME parameter to the new hostname. Your configuration file should look something like this:

/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=”newhostname.domainname.com”
GATEWAY=”192.168.0.1″GATEWAYDEV=”eth0″
FORWARD_IPV4=”yes”

You’ll also need to replace all occurencies of your old hostname in /etc/hosts. If your Linux box uses DHCP to obtain its IP address, you’ll also need to edit /etc/dhclient-eth0.conf (assuming your ethernet adapter is named eth0) and adjust the send host-name parameter correctly.

When you’re done, reboot your computer for the change to take effect.

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment




 

Top 10 Linux Hosting Providers

InMotion Hosting - $5.95
WebHostingHub - $4.95
iPage - $2.99
JustHost - $3.45
HostGator - $4.95
FatCow - $3.67
GreenGeeks - $4.95
HostMonster - $5.95
BlueHost - $6.95
10 GoDaddy - $4.31
 
 
 
 

Tutorials by Category

 
 

Recent Comments

 
© Copyright 2010 - TheWebHostingHero.com