DNS settings for the mail server

The settings for the domain that you have ordered when activating the service will automatically be applied to your server. 

For the email to function properly, every domain that you add to your server should be connected to this domain (use the same MX record)

This way you will avoid that your email messages end up in the spam folder or that they get rejected because there's no reverse DNS (PTR) and SPF record (especially for gmail).

If there is no SPF record in the DNS, especially when communicating with Gmail, Yahoo or Outlook servers, your emails will most probably end up in the spam folder.

In order to set up the mail system for your domains it is necessary that you add the following records to the DNS. To set up DNS for the domains which point to mCloud name servers, you should use the AnycastDNS service. The same parameters ahould be entered in case the domain resides with a different provider.

  • The first step is adding an MX record for the domain. This is a hostname for your server, i.e. mail.maindomain.com. 
    AFter that you should also add the SPF and PTR records dor the domain:
    • PTR record:

      - This PTR record will be used for matching the DNS name with an IP address. The validity of the email messages from the mail server will depend on whether this record exists or not.
  • Detailed in strucions on how to add this record can be found here. 
  • The SPF record is added by adding a TXT record for the domain by using the AnycastDNS:
  • We recommend that you set up a more restrictive SPF record: 

    v=spf1 mx  -all
    This way only the emails sent from the MX server will be validated, while the rest of them will not (all). In case you set the SPF record in this format, it will tell the recipeint that only emails sent from the email servers which are defined with the MX DNS record are valid, while the rest of the emails aren't.
  • A less restrictive form of the SPF record would be:
  • v=spf a mx ip4:xxx.xxx.xxx.xxx -all 
    Fields xxx.xxx.xxx.xxx should be replaced with an actual IP address of your web/app servers or the mailing list. 
    Please take care about setting up the scripts for sending emails from a web server. When a web server and an email server aren't on the same physical server, the web script has to be set up so that it is using the email server for a specific domain (which is specified in the MX DNS record). Be sure to set up a dedicated email account for sending emails from the scripts.

Note: in case you change the IP address of your web/app server or the mailing list, the SPF record has to be updated accordingly!

Set DNS records for a mail server with multiple domain names

After activating the server and setting the DNS record for the primary server domain, you can set up the rest of the user domains.

Enter the name of your email server into the MX record for each of the domains you are pointing to this email server, which will also be the hostname of your server (mail.maindomain.com).

The same rules which are applied to the main domain will also be applised to the SPF records of the addon domains.

In case you are hosting multiple websites for different owners on your mail server, we suggest that you set up the domain with your company or agency name as the main domain. 

After activating the server and setting up the DNS records for the primary domain server, you can start adding the rest of the user domains.

The MX record of each addon domains which will be directed to this email server you shouldenter the name of this email server which is also the hostname of your server (mail.maindomain.com).


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 7335