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
- 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?
Once connected to the server, type the following replacing my.hostname.com with your hostname:
- Update the network file changing the hostname portion once again to your specific hostname:
$ vi /etc/sysconfig/network
Dedicated or Elastic Enterprise Cloud Accounts with cPanel/WHM
- Login to WHM by going to https:/ip address:2087 in a web browser.
- Go to Basic WHM/cPanel Configuration
- Set the hostname and click “Save”.
- Log into the server via SSH and run the following to reactivate your WHM license:
Dedicated or Elastic Enterprise Cloud Accounts with Plesk
- Log into Plesk by going to https:/<ip_address>:8443.
Once logged in, click Server.
Click Server Preferences and enter in the new hostname in the Full hostname field. Then click Save.
- 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