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

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!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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 Afzender Ontvanger Datum Vandaag 09:40 Return-path: Received: from [] (port=41055 by with esmtpa (Exim 4.86) (envelope-from 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 From: To: Subject: test Message-ID: X-Sender: User-Agent: Roundcube Webmail/1.1.3

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?