Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
server-administration:changing-hostname [2009-10-14 22:40:46]
garrett.plasky created
server-administration:changing-hostname [2011-05-14 00:01:32]
garrett.plasky Approved
Line 3: Line 3:
 Change the hostname line in /etc/sysconfig/network to the hostname you want (this file may be different on FreeBSd and others). Your hostname should be something prefixing a domain you own (this is referred to as a fully qualified domain name, FQDN), so server1.yourdomain.com for example, not just yourdomain.com. Changing it in that file ensure that your hostname gets set each time networking starts, however you'd need to restart networking for it to get set in the current session with just that changed. This is not required for our current running environment however, we can just set it with the hostname command. To do so run: Change the hostname line in /etc/sysconfig/network to the hostname you want (this file may be different on FreeBSd and others). Your hostname should be something prefixing a domain you own (this is referred to as a fully qualified domain name, FQDN), so server1.yourdomain.com for example, not just yourdomain.com. Changing it in that file ensure that your hostname gets set each time networking starts, however you'd need to restart networking for it to get set in the current session with just that changed. This is not required for our current running environment however, we can just set it with the hostname command. To do so run:
  
-<code console>hostname server.yourdomain.com </code>+<sxh bash>hostname server.yourdomain.com </sxh>
  
-Where hostname is followed by what you want the hostname to be. If you run a cPanel machine, you'll want to force a re-sync on the license file after any hostname change, to do so run the following command: +If you are running a cPanel server, you will want to simply change the hostname in under both ** Main >> Server Configuration >> Basic cPanel/WHM Setup** and **Main >> Networking Setup >> Hostname**.
- +
-<code console>/usr/local/cpanel/cpkeyclt</code>+
  
 {{tag>cpanel centos ubuntu how-to}} {{tag>cpanel centos ubuntu how-to}}