In order to configure SPF and DKIM for Mailgun you have to added your domain/s or subdomain/s in their Control panel. Please follow the below steps to add the SPF and DKIM record for Mailgun:
- Sign in to your domain account at your domain host
- Locate page for updating your domain’s DNS records
- Find your TXT records to check if you have an existing SPF record
- If you have an existing SPF record, follow the instructions below to update an existing SPF record with multiple mail servers.
- In your existing SPF record, you will append include:mailgun.org
- For example, if your existing record looked like v=spf1; mx; ip4:220.127.116.11; you would add the above include as follows v=spf1; mx; ip4:18.104.22.168; include:mailgun.org;
- If you do not have an SPF record, Create a new TXT record with the following values:
- In the Name/Host/Alias field, enter @ or leave blank (other DNS records might indicate which one you need)
- In the Time to Live (TTL) field, enter 3600 or leave the default
- In the Value/Answer/Destination field, enter: v=spf1 include:mailgun.org ~all and Save the TXT record
1. The DKIM record that you will have to add to your DNS will be shown to you in the “Domain Verification & DNS” section in the MailGun control panel.
2. Share this TXT record with your DNS provider.