Setting up SPF and DKIM on your DNS provider





In order to deliver emails on your behalf, we require you to update your DNS records with SPF, DKIM rand MX records. SPF and DKIM are internationally recognised standards that “vouch” for the emails that we send from your domain (this prevents spoofing). Mail Exchanger (MX) records specify the mail server responsible for accepting email messages on behalf of a domain name.  They're the records that ensure replies to your emails get back to your inbox.


You can use either your main (root) domain when sending emails, a Sub-domain, or a completely separate domain.  

If you're confident of your data quality, using your root domain is preferable as it will improve deliverability and engagement rates.  If you have concerns about your data quality, or are expecting to use Kulea to send out large quantities of email, you should consider using either a sub-domain, or a domain dedicated to marketing communications, as this keeps your day to day emails and your marketing emails clearly separated in the eyes of the ESPs.  In the following example, we will be using kma05.co.uk as the root domain, and ‘comms’ as the subdomain i.e. comms.kma05.co.uk


During your own set up, please replace comms.kma05.co.uk with your own domain details. Unless specifically requested otherwise, we will always use the subdomain ‘comms’ ie. comms.yourdomain.com in this guide.  


If you are using your root domain, rather than a subdomain, simply ignore references to 'comms'.


Steps


1. Go to your DNS provider


Go to the DNS provider that you use to manage your domain (in our case Gandi.net) and add the TXT records provided by your agency.


Common providers include GoDaddy, NameCheap, Network Solutions, Rackspace Email & Apps, Rackspace Cloud DNS, Amazon Route 53 and Digital Ocean.



2. Add DNS Records For Sending


TXT records (known as SPF & DKIM) are required to send email with Mailgun.


The SPF and DKIM TXT records will have been provided by your agency or Kulea account manager. They will be in a format similar to the example records below.  The first row is the SPF record.  The second row is the DKIM record.




Although each DNS provider has a different interface, the setup will be roughly similar.


In the following example, you can see how we have added the above records to our own DNS provider, Gandi.net.


Please note, in our DNS interface below, we need only add the subdomain, not the entire domain to the name field (Gandi automatically adds the root domain for us). This is a particular foible of Gandi - every DNS provider is different. If in doubt, please speak to your DNS provider.  If using a root domain, you can normally leave the name field blank (or use an @ symbol)



Adding the SPF record*Adding the DKIM record


*MERGING SPF RECORDS Please note, you can only have one SPF record per domain.  If you already have an SPF record in place you will need to merge your new Mailgun record with your existing record/s.  


For example, if you have these 2 SPF records v=spf1 include:_spf.google.com ~all and v=spf1 include:mailgun.org ~all 


You can combine them to this v=spf1 include:_spf.google.com include:mailgun.org ~all 


The newly created SPF record sets a policy for your domain, telling mail servers across the Internet that emails sent from the addresses associated with your domain should only be accepted if these have been relayed using the Mailgun and Google mail servers.   If in doubt, please speak with your DNS provider.


3. Check your record has been correctly added


To check that you have correctly added the records, we recommend using MX Supertools. This allows you to check both your SPF and DKIM records. See below.
Please note, it can sometimes take a couple of hours for your changes to take effect.


SPF look up (successful result).



DKIM look up (successful result).



Setting up MX records on your DNS provider




In addition to SPF and DKIM records, when using a subdomain, we also require that you add MX records to improve your email deliverability. MX records should only be added for subdomains, NOT  root domains (which should already have your email provider's MX records set up). 


Step 1.  Go back into your DNS provider (hopefully you've still got it open from before!)


Either your account handler or your agency will provide you with the following MX records:



Step 2.  Adding the MX records


Simply select "create MX record" in your interface and copy and paste in the details provides.  You'll need to do this twice, once for each record.  Note, another foible of Gandi (our DNS provider) is that we have to put a full stop after the MX record value.  You may not have to do this.


Adding the 1st MX record
Adding the 2nd MX record


3. Check your record has been correctly added


To check that you have correctly added the records, we recommend using MX Supertools. This allows you to check MX records. See below.
Please note, it can sometimes take a couple of hours for your changes to take effect.


SPF look up (successful result).


That’s it. Simple!