SPF, DKIM and DMARC for Mailgun

Email API

1. SPF

Add include:mailgun.org to your SPF record. If you already have one, add it before the ~all/-all at the end; do not publish a second record.

v=spf1 include:mailgun.org ~all

Mailgun's example record: v=spf1 include:mailgun.org ~all. Add the include to your existing record rather than creating a second one.

Source: Mailgun SPF documentation

2. DKIM

Add the DKIM TXT record shown under Domain Verification & DNS for your domain in the Mailgun control panel.

Source: Mailgun DKIM documentation

3. DMARC

DMARC is a record you publish yourself; it covers all services that send as your domain. Start with monitoring:

v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com;

Publish it as a TXT record named _dmarc. When reports show your mail passes, move to quarantine and then reject. Build yours.

4. Check it

After the records are live, check your domain to confirm SPF stays within 10 DNS lookups and DKIM is found.

Provider docs change. If something here no longer matches, follow the provider's page and tell us at support@shieldbyte.app.