Revset
Book a Free Audit

30-minute call · No obligation

HomeGHL HubSettings & AdminSet Up Mailgun DNS in Cloudflare for GoHighLevel
REVSET LABS · EXPERT GUIDE·Settings & Admin

Set Up Mailgun DNS in Cloudflare for GoHighLevel

1,026 words·4 min read·Updated 27 April 2026·beginner·
Arsalan ZaffarArsalan ZaffarLinkedIn

👉 Start your 30-day GoHighLevel free trial.

Start 30-Day Free Trial
Quick Answer

To set up Mailgun DNS in Cloudflare for GoHighLevel, log into your Cloudflare dashboard, navigate to DNS → Records, and add the required TXT, MX, and CNAME records. This process typically takes 15-20 minutes to complete, ensuring robust email delivery for your campaigns.

Key Takeaways
  • Always use a subdomain (e.g., `mg.yourdomain.com`) for Mailgun to avoid conflicts with existing email services like Google Workspace.
  • Carefully copy the exact 'Name' and 'Content' values from your Mailgun domain settings, especially for the second TXT (DKIM) and CNAME records.
  • Ensure the CNAME record's proxy status in Cloudflare is set to 'DNS only' (grey cloud icon) to prevent tracking issues.
  • Verify all DNS records in your Mailgun account after adding them in Cloudflare; re-click the verification button if records don't turn green immediately.
  • Patience is key; DNS propagation can take a few minutes for records to update and verify, so allow some time before re-checking.

Why Set Up Mailgun DNS in Cloudflare?

Setting up Mailgun DNS records in Cloudflare is crucial for ensuring your emails sent through GoHighLevel reach their destination reliably. Mailgun acts as your email service provider, handling high volumes of emails and improving deliverability. By configuring these specific DNS records in Cloudflare, you authorize Mailgun to send emails on behalf of your domain, authenticate your messages, and enable tracking functionalities. This setup is fundamental for successful email marketing and communication within GoHighLevel.

Access Your Cloudflare DNS Settings

Before you can add any Mailgun records, you need to log into your Cloudflare account and navigate to the DNS management section for your domain. This is where you will create all the necessary entries.

1
Log in to CloudflareGo to the Cloudflare website and sign in to your account.
GoHighLevel screenshot
0
2
Select Your DomainFrom your Cloudflare dashboard, click on the specific domain where you want to set up Mailgun.
GoHighLevel screenshot
1
3
Go to DNS RecordsIn the left-hand menu, click on DNS, then select Records.
GoHighLevel screenshot
2
GoHighLevel screenshot
🔥 Pro Tip

If you already use your main domain for another email service like Google Workspace, always use a subdomain (e.g., `mg.yourdomain.com` or `replies.yourdomain.com`) for Mailgun. This prevents conflicts with existing MX records.

Add the First TXT Record (SPF)

The first TXT record is your Sender Policy Framework (SPF) record. It tells receiving email servers which IP addresses are authorized to send emails from your domain, significantly reducing the chances of your emails being marked as spam.

1
Click 'Add Record'On the DNS Records page, click the + Add Record button to create a new DNS entry.
2
Select Record TypeFrom the 'Type' dropdown menu, choose TXT.
3
Enter the 'Name' (Host)For a main domain (e.g., `yourdomain.com`), enter @. For a subdomain (e.g., `mg.yourdomain.com`), enter only the subdomain part, such as mg or replies.
GoHighLevel screenshot
0
4
Enter the 'Content' (Value)Paste the following exact record value: `v=spf1 include:mailgun.org ~all`.
5
Save the RecordClick Save to add the first TXT record to your Cloudflare DNS.
GoHighLevel screenshot

Add the Second TXT Record (DKIM)

The second TXT record is for DomainKeys Identified Mail (DKIM). DKIM adds a digital signature to your emails, verifying that the email was not altered in transit and truly originated from your domain, further boosting trust and deliverability.

1
Click 'Add Record' AgainClick the + Add Record button once more to create another DNS entry.
2
Select Record TypeFrom the 'Type' dropdown menu, choose TXT.
3
Enter the 'Name' (Host)Go to your Mailgun domain settings page and copy the exact 'Hostname' provided for the second TXT record. This value is unique and often starts with `k1._domainkey`.
4
Enter the 'Content' (Value)Return to your Mailgun domain settings and copy the entire long string of characters provided as the 'Value' for the second TXT record; paste this into the 'Content' field in Cloudflare.
5
Save the RecordClick Save to add the second TXT record.
GoHighLevel screenshot
0
🔥 Pro Tip

The 'Name' and 'Content' for this DKIM record are unique to your Mailgun setup. Always copy them directly from Mailgun to avoid errors.

Try GoHighLevel Free

Start your 30-day GoHighLevel free trial

Everything in this guide is in your free trial. 30 days, no credit card — the platform behind 78+ revenue systems.

Start 30-Day Free Trial

Some links are affiliate links — if you sign up we may earn a commission, at no extra cost to you. We only recommend GoHighLevel because we build on it every day.

Add the First MX Record

Mail Exchanger (MX) records tell other mail servers where to send incoming emails for your domain. Mailgun uses MX records to process bounces and handle replies, which is essential for accurate campaign tracking.

1
Click 'Add Record' AgainClick the + Add Record button.
2
Select Record TypeFrom the 'Type' dropdown menu, choose MX.
GoHighLevel screenshot
0
3
Enter the 'Name' (Host)For a main domain, enter @. For a subdomain (e.g., `mg.yourdomain.com`), enter only the subdomain part, such as mg or replies.
4
Enter the 'Mail Server' (Value)Paste the following exact value: `mxa.mailgun.org`.
GoHighLevel screenshot
1
5
Set the 'Priority'Enter 10 for the priority. This value is standard for Mailgun MX records.
6
Save the RecordClick Save to add the first MX record.
GoHighLevel screenshot
2
GoHighLevel screenshot
GoHighLevel screenshot

⚠️ If you use your main domain for another email service, ensure Mailgun's MX records are added only for your Mailgun subdomain to prevent email routing issues for your primary email.

Add the Second MX Record

Just like the first MX record, the second one provides redundancy and ensures Mailgun can reliably handle incoming mail for your domain, which includes bounce notifications and direct replies.

1
Click 'Add Record' AgainClick the + Add Record button.
2
Select Record TypeFrom the 'Type' dropdown menu, choose MX.
3
Enter the 'Name' (Host)For a main domain, enter @. For a subdomain (e.g., `mg.yourdomain.com`), enter only the subdomain part, such as mg or replies.
4
Enter the 'Mail Server' (Value)Paste the following exact value: `mxb.mailgun.org`.
5
Set the 'Priority'Enter 10 for the priority. This value is standard for Mailgun MX records.
6
Save the RecordClick Save to add the second MX record.

Add the CNAME Record (Tracking)

The CNAME record is essential for email tracking, allowing Mailgun to track opens, clicks, and other engagement metrics within your GoHighLevel campaigns. This record points a subdomain to Mailgun's tracking servers.

1
Click 'Add Record' AgainClick the + Add Record button.
2
Select Record TypeFrom the 'Type' dropdown menu, choose CNAME.
3
Enter the 'Name' (Host)Go to your Mailgun domain settings page and copy the exact 'Hostname' provided for the CNAME record (e.g., `email` for a main domain or `email.mg` for a subdomain).
4
Enter the 'Target' (Value)Paste the following exact value: `mailgun.org`.
5
Set Proxy Status to 'DNS Only'Click the orange cloud icon under 'Proxy status' to change it to a grey cloud, indicating 'DNS only'. This is critical for proper tracking.
6
Save the RecordClick Save to add the CNAME record.
🔥 Pro Tip

Always ensure the CNAME record is set to 'DNS only' (grey cloud) in Cloudflare. If it remains 'Proxied' (orange cloud), Mailgun's tracking functionality will not work correctly.

Verify DNS Settings in Mailgun

After adding all five DNS records in Cloudflare, you must return to Mailgun to verify that the records have propagated and are correctly recognized. This step confirms your domain is ready for email sending.

1
Go to Mailgun Domain SettingsNavigate back to your Mailgun account and the specific domain's settings page where you obtained the DNS records.
2
Click 'Verify DNS Settings'Locate and click the Verify DNS Settings button. Mailgun will check for the presence and correctness of your records.
3
Re-verify if NeededIf some records do not immediately show a green checkmark, wait a few minutes for DNS propagation, then click Verify DNS Settings again. Continue to re-click until all records are verified.

✅ Once all records show green checkmarks, your Mailgun setup in Cloudflare is complete. You can now proceed to find your Mailgun API Key and integrate it into GoHighLevel.

🔥 Pro Tip

DNS propagation can take up to an hour, but often completes in minutes. If records don't verify after 30 minutes, double-check your entries against Mailgun's provided values.

Troubleshooting Common Issues

⚠️ DNS records not verifying in Mailgun
Double-check each record's Type, Name, Content/Mail Server, and Priority in Cloudflare against the exact values provided by Mailgun. Ensure the CNAME record's proxy status is set to 'DNS only' (grey cloud). Wait 5-10 minutes for propagation and re-click 'Verify DNS Settings'.
⚠️ Incorrect hostname for TXT (DKIM) or CNAME record
Revisit your Mailgun domain settings page. Copy the *exact* hostname values provided there for the second TXT and CNAME records. Do not manually type them or include your root domain if Mailgun provides a partial hostname (e.g., `k1._domainkey` instead of `k1._domainkey.yourdomain.com`).
⚠️ Mailgun email tracking not working (opens/clicks)
Verify your CNAME record in Cloudflare. Ensure its 'Proxy status' is explicitly set to 'DNS only' (grey cloud icon). If it's orange ('Proxied'), click the cloud to change its status, then save.
⚠️ Emails are still failing to send after setup
Confirm that all DNS records show green checkmarks in Mailgun. If they do, ensure you have correctly entered your Mailgun API key into GoHighLevel's integration settings. Test sending an email from within GoHighLevel's conversations tab.
⚠️ Conflict with existing email services (e.g., Google Workspace)
If your main domain handles email with another provider, you must use a dedicated subdomain (e.g., `mg.yourdomain.com`) for Mailgun. This prevents Mailgun's MX records from interfering with your primary email service's MX records.

Common Mistakes to Avoid

  • Forgetting to set the CNAME record's proxy status to 'DNS only' (grey cloud) in Cloudflare.
  • Including the root domain in the 'Name' field for subdomain records (e.g., entering `mg.yourdomain.com` instead of just `mg`).
  • Not patiently waiting for DNS propagation time before re-verifying records in Mailgun.
  • Copying incorrect or incomplete values from Mailgun for the second TXT (DKIM) or CNAME records.
  • Attempting to use the main domain for Mailgun when another email service (like Google Workspace) already uses it, leading to MX record conflicts.

Frequently Asked Questions

QWhat is the purpose of each DNS record (TXT, MX, CNAME) for Mailgun?
The TXT (SPF and DKIM) records authenticate your domain and emails, proving they are legitimate and not spoofed. MX records direct incoming mail, allowing Mailgun to handle bounces and replies. The CNAME record enables Mailgun to track email opens and clicks, providing valuable engagement data within GoHighLevel.
QHow long does it take for Mailgun DNS records to verify in Cloudflare?
While DNS propagation can sometimes take up to 48 hours, changes in Cloudflare typically propagate much faster, often within 5-10 minutes. You should re-check verification in Mailgun after this brief waiting period. If records still don't verify, double-check your entries.
QCan I use my main domain for Mailgun if I already use it for Google Workspace?
No, it is strongly recommended to use a subdomain (e.g., `mg.yourdomain.com`) for Mailgun if your main domain is already used by another email service like Google Workspace. Using the main domain for both can cause MX record conflicts and disrupt your primary email service.
QWhere do I find the exact record values for Mailgun's second TXT and CNAME?
You must log into your Mailgun account, navigate to your domain settings, and find the 'DNS records' section. Mailgun provides the precise 'Hostname' and 'Value' for the second TXT (DKIM) and CNAME records there. Copy these values directly to avoid errors.
QWhat should I do if some Mailgun DNS records don't show a green checkmark after verification?
First, wait a few more minutes and try clicking the 'Verify DNS Settings' button again in Mailgun. If issues persist, meticulously review each record in Cloudflare for typos, incorrect types, or missing data. Pay close attention to the CNAME's 'DNS only' status and the 'Name' field for subdomains.
Try GoHighLevel Free

Start your 30-day GoHighLevel free trial

Everything in this guide is in your free trial. 30 days, no credit card — the platform behind 78+ revenue systems.

Start 30-Day Free Trial

Some links are affiliate links — if you sign up we may earn a commission, at no extra cost to you. We only recommend GoHighLevel because we build on it every day.

Arsalan Zaffar
Arsalan Zaffar
Revset Labs · Revenue Systems · 78+ GHL Builds

Arsalan writes GHL guides from real build experience — 78+ systems, $9.2M in client pipeline. Wharton, CXL & Google certified.

Connect on LinkedIn
Tags:MailgunCloudflareDNSEmail SetupGoHighLevelDeliverability