Rackspace Community

Preparing the Cloud Server to be a Mail Server

Article ID: 418

Last updated on August 13, 2013

Authored by: Rackspace Support

Warning: Email in the Cloud (Rackspace or otherwise), even with today's vast standards, is considered to be "best effort" without any guarantees for reliability or deliverability. Follow the steps below to have a better email sending reputation. As an additional precaution, it is helpful to research and consider using the following:

It is vital that the Cloud Server has the basics such as the hostname and Reverse DNS correctly set before we configure any sort of mail service. This article looks at the hostname and reverse DNS (RDNS) settings on the Cloud Server.

Hostname

This is simply the 'name' of the Cloud Server and is used in the headers of the email (the headers can be thought of as the address and sender label on the email).

Setting the hostname via the command line involves the very simple adjustment of a couple of files.

We can start by checking what the current hostname is:

hostname -f

On my Cloud Server, the output is:

cloudserver1

For these basic articles I am going to use the domain 'mail.democloud.com' - I am setting up a mail server so that makes sense.

I need to change the hostname to match the domain:

sudo nano /etc/hostname

Replace the current hostname (cloudserver1) with the one you need (in this case mail.democloud.com).

The second file to edit is:

sudo nano /etc/hosts

The default looks like this on my Cloudserver:

127.0.0.1 localhost localhost.localdomain
127.0.0.1 cloudserver1

Following on from what we are doing, replace 'cloudserver1' with 'mail.democloud.com'.

Of course, replace mail.democloud.com with your domain.

Reboot

Conduct a quick reboot:

sudo shutdown -r now

and check the hostname:

hostname -f

The output is now:

mail.democloud.com

Good start!

Reverse DNS

Now, we need to properly set the reverse DNS for the server.

Change Reverse DNS in the Control Panel

Navigate to your Server's DNS tab and scroll down to the Reverse DNS section. Change the relevant field to the domain name which you'd like in the rDNS record. (See DNS - Creating a Reverse DNS Record)

Check the Reverse DNS

The RDNS may take a while to propagate and you really need to wait until it has done so before you can fully configure and test any mail setup.

To check the RDNS, you need to input the IP address if the Cloud Server into the 'dig' command.