Adding and Verifying a Sending Domain in Mailgun (Follow the Steps Below)

1. Log in to the Mailgun control panel and confirm your region

  • Select the US or EU region in the top right corner. Domains and data are isolated by region, so use the same region for subsequent operations.

2. Go to the add domain section

  • In the left sidebar, go to Send → Domains and click Add New Domain in the top right corner.
  • If the button is unavailable, check whether you need to add a credit card in the billing settings.

3. Enter the domain and region

  • Enter your sending domain in Domain name. A subdomain (such as mg.your-domain.com) is recommended to manage sending reputation and DNS records separately. Then select the US or EU region in Domain region.

4. Add DNS records at your DNS provider as prompted by the panel

  • Mailgun provides the required SPF and DKIM TXT records, along with optional CNAME and MX records. CNAME is used for open or click tracking. Configure MX only if you need to receive or route emails.
  • Common examples (for illustration only; use the actual values from the panel): SPF (TXT): v=spf1 include:mailgun.org ~all DKIM (TXT): The hostname is typically kxxx._domainkey.mg.your-domain.com, and the value is generated by the panel. CNAME (tracking, optional): Points to mailgun.org
  • Keep only one SPF record for the same domain: If an SPF record already exists, merge include:mailgun.org into the existing record.
  • Procedures vary slightly between DNS providers. Refer to your provider's Mailgun configuration guide.

5. Wait for DNS propagation and click "Verify"

  • After DNS propagation, return to the Mailgun domain page and click "Verify". Domain verification is complete when both SPF and DKIM are shown as verified.

6. Create/View SMTP credentials

  • Go to the domain's Domain settings / SMTP credentials and create or view an SMTP user for the domain (commonly postmaster@your-domain.com or a user you created). The SMTP password is only shown once, so store it securely. Use the full email address as the login name.
  • Sending settings: SMTP server smtp.mailgun.org, port 587 (STARTTLS) or 465 (TLS).

After completing these steps, enter the domain's SMTP credentials in "Extended Services" in the Admin Console and save them.