×
×

Knowledgebase

The knowledgebase provides documentation written by our team. Please select a category or search for answers.

Articles

Change Hostname

1. Change Hostname In WHM Select Change Hostname from the Server Setup section on the menu to the left. Enter the new hostname in the box and click 'Change'. Hostnames should have two dots in them and should be setup as if they're a subdomain of your server's main domain name. So, if your server's main domain is mybox.com, your hostname could be something like server01.mybox.com. WHM then prompts you to add an 'A Entry for your hostname' if you don't already have one (see bnext point)

2. Add an 'A' Entry You can do this by going to the DNS Functions area of the left menu and selecting Add an A Entry for your Hostname. It will ask you to confirm the details: press Add the entry to do so.

3. Manual Checks Now this didn't work fully when we did it, so we had to check some stuff manually (none, some or all of these may need ameding in your environment).

    (a) SSH to your server and do the following:

         # /usr/local/cpanel/cpkeyclt (to fix cpanel licesnse key) 'hosts'file         

   (b) pico /etc/hosts and check that the entries are as follows - 127.0.0.1 localhost xxx.xxx.xxx.xxx server01.mybox.com server01 - replacing xxx.xxx.xxx.xxx with your server's IP address and adding your hostname after it. Hit CTRL+X and reply 'y' to exit pico and save the file. Apache

    (c) pico /etc/httpd/conf/httpd.conf, scroll down and find the ServerName entry and make sure your fully qualified hostname (i.e. server01.mybox.com) is specified after it. While you're there, you may want to change the ServerAdmin e-mail (just above the ServerName) too. Hit CTRL+X and reply 'y' to exit pico and save the file. wwwacct.conf

   (d) pico /etc/wwwacct.conf, scroll down and find the HOST entry and make sure your fully qualified hostname (i.e. server01.mybox.com) is specified after it. Hit CTRL+X and reply 'y' to exit pico and save the file. resolv.conf

   (e) pico /etc/resolv.conf, and check that the first two lines read as follows - domain mybox.com search mybox.com Replacing mybox.com with your server's primary domain name and adding your own nameservers to the file. Hit CTRL+X and reply 'y' to exit pico and save the file. network

   (f) pico /etc/sysconfig/network, and check that HOSTNAME line specifies your host name. Hit CTRL+X and reply 'y' to exit pico and save the file. You may need to reboot your box to make hostname changes take effect.