Prepare a Cloud Server to be a mail server
Warning: Managing a mail server in the cloud provides no guarantee email is delivered to recipients’ inboxes. Establishing and maintaining email deliverability is a complex undertaking. If you need a managed email solution, see our hosted email offerings.
To improve your email server’s sending reputation, you need to research and consider using the following solutions:
- DomainKeys Identified Mail (DKIM)
- Domain-based Message Authentication, Reporting, and Conformance (DMARC) DNS records
Before you configure any sort of mail service, it is vital that your Cloud Server has the hostname and Reverse Domain Name System (RDNS) correctly set. This article reviews the hostname and RDNS settings necessary to configure Cloud Server for email.
The instructions in this article use the following technology:
- The Ubuntu® Hardy operating system. (The instructions might work on other Linux® distributions, but it has not been tested and is not guaranteed).
Configure the hostname
A hostname is the name of the Cloud Server. The hostname is used in the headers of the email. You can think of the headers as the address and sender label on the email.
Setting the hostname via the command line involves the adjustment of a couple of files.
Start by checking what the current hostname is:
On the example Cloud Server, the output is:
Note: These instructions use the domain mail.democloud.com.
Change the hostname to match the domain:
sudo nano /etc/hostname
Replace the current hostname
cloudserver1with your selected domain name, which in this example is mail.democloud.com.
You can open the second file to edit for editing by using the following command:
sudo nano /etc/hosts
The default looks like this on the example Cloud Server:
127.0.0.1 localhost localhost.localdomain
mail.democloud.com. On the Cloud Server, replace
mail.democloud.comwith your domain.
Verify hostname changes by rebooting the Cloud Server and checking the hostname output by using the following sequence of commands:
sudo shutdown -r now
The output is now:
mail.democloud.com is an example of a hostname.
Change the RDNS in the Control Panel
Now, you must configure the RDNS on the server.
Navigate to your server’s DNS tab and scroll down to the Reverse DNS section.
Change the relevant field to the domain name that you want in the RDNS record. For detailed instructions, see DNS - Creating a Reverse DNS Record.
Verify RDNS changes
The RDNS can take 24 to 48 hours to propagate. We recommend that you wait until the changes have fully propagated before you configure and test any mail setup.
To check the RDNS, you must input the Internet Protocol (IP) address of the Cloud Server
dig function on a base Ubuntu Hardy Cloud Server by using the following command:
`sudo aptitude install dnsutils`
Now you can verify that the RDNS changes are correct.
Check the RDNS output by using a
`dig -x 184.108.40.206`
In this case, the output includes the correct answer:
dig -x 220.127.116.11 ... ... ;; QUESTION SECTION: ;18.104.22.168.in-addr.arpa. IN PTR ;; ANSWER SECTION: 22.214.171.124.in-addr.arpa. 3477 IN PTR mail.democloud.com.
Even if you are only sending mail from your application to an administrator, remember that it is critical that the Cloud Server is properly configured before you configure it as a mail server.
©2019 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License