MailSuite Pro documentation

DNS configuration guidelines

To ensure smooth delivery of your messages to other servers, it's important to maintain valid DNS records of the domains you're sending mail from. There are multiple records which can affect this, and this article will go through the most typically used ones.

For the sake of simplicity, we're assuming that you're sending mail from mydomain.com which resolves to IP address 11.22.33.44 and the mail server you're configuring this for is available on that address.

Please also bear in mind that the specifics of DNS configuration largely depend on the service you register the domain name at, so it's not really possible to offer any screenshots here to demonstrate the configuration. But the basic ideas and principles usually apply everywhere with little to no exceptions.

A record

This record defines the relation between the domain name and its IP address. If you run the following command in your operating system's command prompt:

nslookup mydomain.com

and assuming the A record is configured correctly, you should see something like this:

Non-authoritative answer:
Name:   mydomain.com
Address: 11.22.33.44

Without such a record, it's not really possible to use the domain name at all, be it email delivery, website hosting or otherwise.

MX record

MX (stands for "Mail eXchange") record means that all the email messages which have @mydomain.com email address as a recipient should be directed to the server assigned in MX record. It's perfectly normal to have mydomain.com website hosted by one server while @mydomain.com email is served by a different one.

In our common case, however, we're keeping it simple, so technically there is no need to have a separate MX record - still, it's recommended to have one. For example, you can create mx.mydomain.com subdomain, pointing to the same primary IP address 11.22.33.44 - and then add the following record:

Record type: MX
Record name: mydomain.com
Record value: mx.mydomain.com
Priority: 5

With MX records, there's a property you probably won't see with any other records - priority. If you have multiple mail servers hosting your email, priority value is there to indicate which one is used first (the one with the lowest priority value), if that one's down for any reason the next one's with a higher priority is used, and so on. But since we only have one server, its priority value can be 5 or 10 or anything else really.

PTR record

As described above, A record is there to control the IP address your domain resolves to. However, when you send email to account hosted by a major service provider like Google, they may check if the IP address resolves back to the domain name correctly as well - something legitimate senders would normally have, while spammers and persons with one-off emails wouldn't:

# nslookup 11.22.33.44
44.33.22.11.in-addr.arpa    name = mx.mydomain.com.

Resolving IP address back to domain name is controlled by PTR record, and this approach is known as reverse DNS lookup. This isn't a type of DNS records universally offered by all the domain name registrars and hosting providers out there, and it's quite possible that in your particular case changing PTR record isn't available. Per our experience, services like Google don't actually require an exact match of A and PTR records, as long as PTR record exists at all (i.e. if IP address resolves to any domain name) this may be sufficient.

DKIM setup

Most of the items listed on this page are solely about DNS configuration and they don't require adjusting anything on mailserver side; aside, perhaps, from primary_hostname value in /etc/exim4/exim4.cnf file. DKIM setup is an exception, it does require making adjustments in Exim setup, and this setup is covered by the separate documentation page: DKIM Configuration

When sending email to Gmail, it's going to be rejected if your domain doesn't have a PTR record; another reason for rejection is that you need to have either DKIM or SPF configured. Naturally, we would recommend to configure both.

SPF setup

This article covers SPF configuration in detail. Per our experience, it's sufficient to add a TXT record, where its name equals the domain name, and its value looks like this:

v=spf1 +a +mx ip4:11.22.33.44

Be sure to supply the actual IP address of your server there.

DMARC setup

Even with DKIM set up correctly, you may still get Alignment warning saying that the From header does not match the DKIM domain, and suggesting you to be careful with the message as the sender may be spoofing the From header identity.

To work around such an issue, and to generally improve the deliverability of your emails, setting up DMARC record is advised. You can add TXT record called _dmarc.YourDomainName with the following value:

v=DMARC1; p=none; pct=100; adkim=s; aspf=s.