Submit a ticket My Tickets
Login  Sign up

SPF Setup for Mailgun

In order to allow Mailgun to send emails using your domain name, all while considering that those emails pass DMARC authentication, you need to setup an SPF record for Mailgun. Find out how you can setup SPF for Mailgun in a few simple steps: 

Steps to Setup SPF for Mailgun 

In order to set up your SPF record with Mailgun or modify your current SPF record to include Mailgun, do the following: 

  • Login to your DNS provider’s control panel

  • Navigate to the page or section allocated for updating your domain’s DNS records. You can do so via DNS Management > Name Server Management > Advanced Settings

  • Locate your  DNS TXT records and find out whether you have a pre-existing SPF record in your system which will start with the mechanism v=spf1. 

Note: if you do have an existing SPF record and you publish another one, this will lead to SPF failure

  •  If you have an existing SPF record, modify the record to include Mailgun in the following way.  

In your existing SPF record, you need to add:

For instance, if your existing record previously looked like v=spf1 ~all your updated record will be v=spf1 ~all. Save changes. 

  • If you don’t have an SPF record in your DNS, you need to create a new record. Follow the instructions given below to create a new DNS TXT SPF record for your domain that includes Mailgun: 

  1. In the field for Name/Host/Alias, enter @ or leave blank depending on how you have published other TXT records in your DNS

  2. In the field for the Time to Live (TTL), you can enter 3600 or leave default

  3. In the Value field, enter: v=spf1 ~all 

  1. Click on Add Record and save the SPF TXT record

Note: Your DNS will take 24 few hours to process the changes, and you’re done setting up SPF for Mailgun. You can now send out DMARC complaint emails using Mailgun on behalf of your domain!

Sign up for your free DMARC analyzer today! 

PowerDMARC is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.