DKIM & SPF Setup for Mailgun
SPF Setup for Mailgun
To set up or edit your SPF record, you will need to add: include:mailgun.org
Edit existing SPF record
- Log in to your DNS hosting provider
- Look for a TXT containing v=spf1
- In your existing SPF record, you will append include:mailgun.org
- For example, if your existing record looks like v=spf1; mx; ip4:1.2.3.4; you would add the above include as follows v=spf1; mx; ip4:1.2.3.4; include:mailgun.org
Create a new SPF record
- Follow the instructions from our How to Create a New SPF Record Guide.
- In the Value field, enter: v=spf1 include:mailgun.org ~all and Save the TXT record.
Records for Subdomains
If you are creating a record for a subdomain, you will want to make sure that you specify the sub part of the domain in the Host/Name/Alias field for most DNS providers.
- Enter the sub part of the domain, for example if the subdomain is mail.mxtoolbox.com you would want to enter mail into that field.
SPF and DMARC Alignment
To set up a custom bounce back email in Mailgun, you need to configure your DNS settings with the correct SPF and DKIM records provided by Mailgun. You'll also need to ensure your domain is verified within Mailgun's control panel. Additionally, you can configure webhooks or use the Mailgun API to handle bounce events and other feedback, allowing you to manage your suppressions list and improve deliverability.
How to Enable DKIM for Mailgun
- 1. Go to the Domains tab and click on your domain
- 2. You can find the DKIM record under the section for "Add DNS Records for Sending"
- 3. Go to your DNS provider and add the DKIM Record
You will add a TXT record with a Name/Host of ._domainkey.yourdomain.com which was provider in the Mailgun console