Setting up Mailgun
1. SPF
If your domain has no SPF record yet, publish the record above as a TXT record at the root of the domain. If it already has one, don't add a second: insert include:mailgun.org into the existing record, before the final ~all or -all. Each include costs DNS lookups, and the limit across the whole record is 10.
2. DKIM
Sending → Domains → your domain → DNS records. Publish the TXT record at the selector Mailgun shows (for example pic._domainkey).
DKIM is what keeps mail authenticated when it is forwarded, and it is the signature DMARC most often relies on, so don't skip it even if SPF passes.
3. DMARC
Publish the starter record at _dmarc with p=none and an address you read. The reports show every service sending as your domain. Once Mailgun and your other senders pass, move to p=quarantine, then p=reject.
Check it worked
DNS changes can take a while to appear. Run your domain through the deliverability checker to confirm SPF, DKIM and DMARC are live, and see the SPF, DKIM and DMARC setup module of the free Academy course for the reasoning behind each record.