Provider guide · updated 2026-09-03
Mailgun: verify a sending domain
Mailgun verifies a domain when its SPF and DKIM records resolve. Mailgun recommends a dedicated sending subdomain, and shows the exact record values in the domain settings page.
Use a sending subdomain
Mailgun recommends adding a subdomain such as mg.example.com rather than the root domain. This keeps Mailgun's SPF and MX records separate from your business mailboxes and avoids conflicts with an existing MX record on the root domain.
Messages can still show From addresses at example.com. DMARC relaxed alignment accepts a subdomain in the SPF or DKIM domain.
SPF
For the US region the include is mailgun.org. The EU region uses a different include. Mailgun shows the exact SPF value for your domain and region under Sending, Domains, then the domain, then DNS records. Copy that value.
| Type | Name | Value |
|---|---|---|
| TXT | mg.example.com | v=spf1 include:mailgun.org ~allEU-region domains use a different include. Use the value shown in the Mailgun domain settings. |
DKIM
Mailgun generates a DKIM key and shows the selector and TXT value in the domain settings. Common selectors include smtp, krs, pic, mailo, email and k1 in older setups, but the selector for your domain is whatever the dashboard shows.
Newer Mailgun accounts may offer DKIM key rotation or a CNAME-based option. Follow the records shown for your domain.
| Type | Name | Value |
|---|---|---|
| TXT | smtp._domainkey.mg.example.com | k=rsa; p=<public key shown in Mailgun>The selector (smtp here) varies by account. Copy the full record name from Mailgun. |
Tracking CNAME and inbound MX
For open and click tracking, add a CNAME at email.mg.example.com pointing to mailgun.org (or the EU tracking host shown in your dashboard). This lets tracked links use your domain.
MX records for Mailgun are only needed if you want Mailgun to receive mail for the subdomain (inbound routes). Do not add Mailgun MX records to a domain whose mailboxes live elsewhere.
| Type | Name | Value |
|---|---|---|
| CNAME | email.mg.example.com | mailgun.orgEU-region accounts use a different tracking host shown in the dashboard. |
| MX | mg.example.com | 10 mxa.mailgun.orgOnly for inbound routes. Add mxb.mailgun.org as a second MX with the same priority. |
DMARC
Publish DMARC on the organizational domain (example.com). It covers mg.example.com automatically unless you add a separate record for the subdomain. Start with p=none and a rua address.
