How to set up DNS records in Digital Ocean to enable external mailhost (SMTP)

Posted August 25, 2016 3.5k views

Hi There,

I want to set the DNS records so they point to the mailserver that uses SMTP.

I am running a droplet on Digital ocean with IP dro.p.l.t
I am running a mailserver on a shared host with ip mai.l.s.v

The SMTP server settings that I got from my shared host are:

SMTP server:
SMTP port: 465
SSL: on
password for SMTP is needed

I have set the following DNS records in Digital Ocean:

DNS records pointing to Droplet: IN SOA 1472136158 10800 3600 604800 1800 1800 IN NS 1800 IN NS 1800 IN NS 1800 IN A dro.p.l.t 1800 IN A dro.p.l.t
* 1800 IN A dro.p.l.t

DNS records pointing to SMTP Mailserver: 1800 IN A mai.l.s.v 1800 IN MX 10 1800 IN TXT “v=spf1 a mx ip4:mai.l.s.v -all” 1800 IN A mai.l.s.v

Are these the correct settings?

Hope someone can help me out. Many thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Overall it looks like these settings should work. Are you encountering errors after setting this up? If so can you share the errors or issues you’re running into?

Hi Ryan,

Thank you for your quick response!

I am not able to send and receive emails on the email host ( Could it have something to do with my SPF record? Should I use in stead of ?

When I send a mail to my google apps email account | get the following error:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

Reporting-MTA: dns;

Action: failed
Final-Recipient: rfc822;
Status: 5.0.0
Onderwerp test
Datum Vandaag 09:40
Received: from [] (port=41055
by with esmtpa (Exim 4.86)
id 1beHBK-0007Ol-PV
for; Mon, 29 Aug 2016 09:40:34 +0200
MIME-Version: 1.0
Date: Mon, 29 Aug 2016 09:40:34 +0200
Subject: test
User-Agent: Roundcube Webmail/1.1.3