Set up SPF for Mailgun
The exact steps in the Mailgun admin console, followed by a checker to confirm the record resolves once you publish it.
Steps
- On the sending domain Mailgun gave you, publish a TXT record with v=spf1 include:mailgun.org ~all.
- If you send from a subdomain (mg.yourdomain.com), the SPF record belongs on that subdomain. SPF does not inherit from the root.
- Mailgun also asks for an MX record on the sending subdomain for bounce handling; add it so envelope alignment and bounce processing work.
Confirm it workedSPF checker
DNS changes take time to propagate. Check the record once you have published it.