What is a hostname and how do I set it?

A server’s hostname allows a server to be uniquely identified on the Internet. An invalid hostname can cause an ISP to flag email messages originating from the server as spam.

First you will need to pick a fully qualified domain name which points to the primary IP of the server. Depending on the type of server you have the below information will show you how to setup or change your hostname. One thing to remember in regards to picking a hostname is that you cannot use a domain name for which you are hosting mail. For example you cannot have a hostname of example.com, if you were hosting mail for this example.com. However mail.example.com would be sufficient, as long as this domain points to the primary IP of your server.

Dedicated or Elastic Enterprise Cloud Accounts with no Control Panel

  1. SSH into the server. If you are connecting from a Windows server and are unsure on how to SSH, please see How do I connect to my account using SSH on Windows?. If you are connecting from a Mac and are unsure on how to SSH, please see How do I connect to my account using SSH on a Mac?
  2. Once connected to the server, type the following replacing my.hostname.com with your hostname:

    hostname my.hostname.com

  3. Update the network file changing the hostname portion once again to your specific hostname:

$ vi /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

GATEWAY=192.168.1.1

HOSTNAME=my.hostname.com

~

:wq!

Dedicated or Elastic Enterprise Cloud Accounts with cPanel/WHM

  1. Login to WHM by going to https:/ip address:2087 in a web browser.
  2. Go to Basic WHM/cPanel Configuration
  3. Set the hostname and click “Save”.
  4. Log into the server via SSH and run the following to reactivate your WHM license:

/usr/local/cpanel/cpkeyclt

Dedicated or Elastic Enterprise Cloud Accounts with Plesk

  1. Log into Plesk by going to https:/<ip_address>:8443.
  2. Once logged in, click Server.
  3. Click Server Preferences and enter in the new hostname in the Full hostname field. Then click Save.

  4. If the server is running Plesk 9 or above, you will need to run the following via SSH substituting in your hostname:

/usr/local/psa/bin/sso -s -server https:/my.hostname.com:11443 -url https:/my.hostname.com:11444