Quick Answer
Add a sending domain in Mailgun, copy its required TXT, MX, and CNAME records into your DNS manager, and then return to Mailgun and click Verify DNS Settings. Use Mailgun’s exact record values rather than example values from another setup.
Verify Your Sending Domain with Mailgun
Mailgun uses DNS records to confirm that you control your sending domain and to configure the domain for email delivery and tracking.
Mailgun provides the exact records required for your domain. You will copy those records into the dashboard of the company that manages your DNS.
Basic workflow: Create and verify your Mailgun account → add a sending domain → add Mailgun’s records to your DNS manager → verify the records in Mailgun → configure tracking and unsubscribe settings.
At a Glance
Sending Service
Mailgun
Recommended Domain
Dedicated subdomain
Common Records
TXT, MX, and CNAME
Possible DNS Delay
Up to 24–48 hours
Before You Begin
Gather the account access needed to configure both Mailgun and your DNS records.
- Make sure you can access the correct Mailgun account.
- Confirm that you can edit DNS records for the domain.
- Consider using a dedicated subdomain such as
mg.example.com. - Check whether the root domain already uses another email provider.
- Use only the DNS values displayed in your own Mailgun domain setup.
If your DNS provider uses an unfamiliar or nonstandard interface, contact that provider’s support team for help entering Mailgun’s records correctly.
Prepare Your Mailgun Account
Step 1: Create a Mailgun Account
Sign up for Mailgun and choose an account option appropriate for your expected sending volume.
Review any sending limits that apply to the selected Mailgun plan before beginning higher-volume campaigns.
Step 2: Verify Your Account
Complete Mailgun’s required account verification steps, including email or phone verification when requested.
Add Your Sending Domain in Mailgun
Step 1: Open Domains
In Mailgun, open the Domains section.
Step 2: Add a Domain or Subdomain
Add the domain you want to use for email sending. A dedicated subdomain, such as mg.example.com, is recommended for greater isolation and control.
Why use a subdomain? A dedicated sending subdomain separates campaign activity from your primary domain and can help protect the primary domain’s reputation if deliverability problems occur.
Add Mailgun’s Records to Your DNS Manager
After adding the domain, Mailgun will display the exact DNS records required for verification and sending. A typical setup may include two TXT records, two MX records, and one CNAME record.
TXT Records
Add the SPF, DKIM, or verification TXT records displayed in your Mailgun setup. These are usually entered as separate records.
MX Records
Add both MX records using the priorities and destination values provided by Mailgun.
CNAME Record
Add the tracking CNAME using the host and destination provided by Mailgun.
Do not copy DNS values from another domain or an example. Every record must match the information displayed inside your Mailgun account.
Host field tip: Some DNS managers require only the subdomain portion in the Host or Name field. For example, if Mailgun displays mailo._domainkey.mg.example.com, your DNS provider may expect mailo._domainkey.mg. Follow the formatting requirements of your DNS provider.
Verify the DNS Records in Mailgun
Step 1: Return to the Domain
After adding the records in your DNS manager, return to the corresponding domain in Mailgun.
Step 2: Verify the DNS Settings
Click Verify DNS Settings so Mailgun can check the published records.
Step 3: Review the Verification Results
Confirm that all required checks show as verified. If a record does not verify, compare its type, host, value, and priority with the values shown in Mailgun.
DNS changes do not always appear immediately. Depending on the DNS provider and previous settings, propagation may take up to 24–48 hours.
Configure Tracking and Unsubscribe Settings
After the domain is verified, review the optional tracking features and configure unsubscribe behavior for that domain.
Step 1: Open Domain Settings
Open Domain Settings for the verified sending domain.
Step 2: Configure Tracking
Enable click tracking and open tracking if you want Mailgun to collect those engagement measurements.
Step 3: Configure Unsubscribe
Locate Unsubscribe, click Edit, choose the appropriate setting, and click Save.
Mailgun Domain Setup Tips
Use a Dedicated Subdomain
Separate campaign sending from your primary domain to provide greater control over sending reputation.
Protect Your Account
Enable two-factor authentication on your Mailgun account when available.
Monitor Sending Activity
Review Mailgun logs and analytics regularly so you can identify sending or deliverability problems early.
Check Existing Email Services
Before configuring a root domain, confirm that the DNS changes will not conflict with an existing service such as Google Workspace.
Frequently Asked Questions
What is the benefit of using a dedicated subdomain for Mailgun?
A dedicated subdomain separates campaign sending from your primary domain. This helps protect your main domain’s reputation if a deliverability issue occurs.
How do I verify my domain in Mailgun?
Add the DNS records provided by Mailgun to your DNS manager. Then return to the domain in Mailgun and click Verify DNS Settings.
Can I use Mailgun with multiple domains?
Yes. You can add and manage multiple domains in Mailgun. Each domain has its own DNS records and settings.
What should I do if my DNS records are not verified?
Check each record’s type, host, value, and priority for errors. Confirm the host format required by your DNS provider and allow time for propagation before verifying again.
How do I enable click and open tracking in Mailgun?
Open Domain Settings for the domain and enable click tracking and open tracking under its tracking settings.
Can I use my root domain in Mailgun?
Yes, but first confirm that the root domain is not already connected to another email service whose DNS records could conflict with the Mailgun configuration.


