MailDoctor Email deliverability check

Guides

Mailgun: SPF, DKIM and DMARC setup

Your app sends through Mailgun, and a receiver reports an SPF, DKIM or DMARC failure. Mailgun sends from a domain you add and verify, often a subdomain such as mail.example.com. Here are its records, and when that subdomain aligns with your From address.

The DNS records Mailgun asks for

Add the domain under Sending, Domains, then copy the records Mailgun shows. The examples use the sending domain mail.example.com.

Which check aligns with DMARC

DKIM alignment alone is enough for DMARC to pass.

Common mistakes

Check your setup

  1. Check your domain with MailDoctor (form below) for SPF, DMARC and the rest.
  2. Check the key with the DKIM key checker on your sending domain: selector pdk1 and pdk2 with Automatic Sender Security, or the selector Mailgun shows.
  3. Check the sending domain's SPF record, and your root record if you changed it, with the SPF lookup counter.
  4. Send yourself a message through Mailgun and paste its headers into the email header analyzer. It shows the Return-Path, the DKIM domain, and which of them aligns.

Marketing mail: Mailgun asks bulk senders to have one-click unsubscribe enabled. See Mailgun's DMARC article.

Sources, checked 27 November 2026: Domain verification · Domain verification setup guide · DKIM security · DMARC · Cloudflare proxy status

Check the domain you send from. Grade, problems and the exact records to fix them.