Mailgun SPF record
Updated 2026-11-18. Lookup counts measured live from public DNS on that date.
The SPF record for Mailgun is include:mailgun.org. If Mailgun is the only service that sends email as your domain, publish exactly this:
| Type | Host | Value |
|---|---|---|
| TXT | @ | v=spf1 include:mailgun.org ~all |
Lookup cost: include:mailgun.org uses 5 of the 10 DNS lookups SPF allows (measured 2026-11-18).
Already have an SPF record?
Do not add a second v=spf1 record. Add include:mailgun.org to the existing one, before the ~all. Example with Google Workspace: v=spf1 include:_spf.google.com include:mailgun.org ~all
Don't forget DKIM
SPF alone is not enough for Gmail, Yahoo, Microsoft or Spamhaus. Mailgun > Sending > Domains > your sending domain > DNS records: publish the TXT DKIM record (selector shown, often k1 or pic) and the SPF TXT on the sending (sub)domain > Verify DNS settings. Official Mailgun guide.
Check your own domain in 5 seconds
Free SPF, DKIM and DMARC check. If something is broken, get the exact records for your setup (€29 one-time).
FAQ
Can I have two SPF records?
No. A domain must publish exactly one TXT record starting with v=spf1. Two records cause a permanent error and SPF fails for every email. Merge all include: entries into one record.
Should I use ~all or -all?
Use ~all (softfail) while you are setting things up and reading DMARC reports. Once every legitimate sender passes, -all is stricter. DMARC policy matters more than the SPF qualifier for most receivers.
How do I check that Mailgun passes?
Send an email to a Gmail address, open it, click the three dots and choose Show original. You want SPF: PASS, DKIM: PASS and DMARC: PASS.
How long do DNS changes take?
Usually 5 to 60 minutes, depending on the TTL of the old record. Some registrars take a few hours.