• Posted November 1, 2013

Can someone please tell me how to get DKIM and SPF set up?

I’d like to use Mailgun or Sendgrid for sending and receiving my email but they (both) require DKIM and SPF records.

I added (their) DNS entries in the DO DNS panel as supplied and they aren’t showing up when I verify on their system so I’m assuming there’s something else I need to do.

My system is CentOS 6.4 x64, Nginx.


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.

Hello there,

We do have an article on How To use an SPF Record to Prevent Spoofing & Improve E-mail Reliability

A DKIM record is another measure that can prevent spoofing and improve mail reliability. You can use any online tool to generate the key for you.

Also if you use any control panel for your server, like cPanel it will have the built-in functionality to create the DKIM record on your behalf

Once created you can use a DKIM checker tool like the one provided from mxtoolbox and check whether the generated key is valid.

Hope that this helps! Regards, Alex

BINGO … that did the trick :)

I discovered by looking my DNS in my cPanel server on another droplet that I was missing the trailing “.” on the entry. ie: I need to tell mailgun to update their instructions.

I did wrap them in quotes yes. As for propagation, Mailgun is already picking up my CNAME entry so there’s no reason it shouldn’t pick up my DKIM and SPF entries. <br> <br>Do I not need to have a local DKIM key installed or will that be handled by theirs? <br> <br>Thanks for your help.

Did you wrap the entries in quotes? Also, remember that DNS records can take up to 48 hours to propagate through the Internet. Check out <a href=“”>How To use an SPF Record to Prevent Spoofing & Improve E-mail Reliability</a>.