To set up Mailgun with your HostGator domain, log into cPanel and navigate to Domains → Zone Editor. You will add five specific DNS records (two TXT, two MX, and one CNAME) to verify your domain with Mailgun. This process typically takes about 15-20 minutes, plus DNS propagation time.
Key Takeaways
✓Always use a subdomain for Mailgun if your main domain already handles emails with another service like GSuite.
✓Carefully copy only the *subdomain part* for hostnames, not the full root domain, when adding DNS records.
✓Verify your DNS settings within Mailgun's interface after adding all required records in HostGator.
✓DNS propagation can take up to 48 hours; re-verify your settings if they don't show as active immediately.
✓Ensure all five required DNS records (two TXT, two MX, and one CNAME) are correctly added to your HostGator Zone Editor.
Why Set Up Mailgun for Email in GoHighLevel?
Setting up Mailgun as your dedicated email service in GoHighLevel is crucial for reliable email delivery. While GoHighLevel offers a default email provider, configuring Mailgun with your own domain significantly improves deliverability rates, reduces spam flagging, and allows for higher sending volumes. This guide walks you through connecting your HostGator domain to Mailgun, ensuring your marketing and transactional emails reach their intended recipients.
Access Your HostGator DNS Zone Editor
All Mailgun setup involves adding specific DNS records to your domain. You will manage these records within your HostGator cPanel. This initial step guides you to the correct location.
1
Log in to cPanel — Access your HostGator account and log in to your cPanel dashboard. This is where you manage your domain's DNS settings.
0
2
Navigate to Zone Editor — In the Domains section of cPanel, locate and click on Zone Editor. This tool allows you to add, edit, or delete DNS records for your domains.
1
3
Manage Your Domain — Find the domain you want to connect with Mailgun in the Zone Editor list. Click its Manage button to view its current DNS records.
2
4
Prepare to Add Records — On the next page, you will see a list of your domain's existing DNS records. You will use the +Add Record button to create new records for Mailgun.
3
🔥 Pro Tip
If you are using a subdomain for Mailgun (e.g., `mg.yourdomain.com`), ensure you select the correct domain from the list before clicking 'Manage'.
Add the First TXT Record (SPF)
The first TXT record is an SPF (Sender Policy Framework) record. This record helps receiving mail servers verify that Mailgun is authorized to send emails on behalf of your domain, significantly reducing the chance of your emails being marked as spam.
1
Select TXT Record Type — Click the +Add Record button and choose Add "TXT" Record from the dropdown menu. This opens the fields for creating a new TXT record.
2
Enter the Hostname (Name) — In the Name field, enter the appropriate hostname for your Mailgun domain. If you are setting up a main domain (e.g., `yourcompany.com`), use `@`. If you are using a subdomain (e.g., `mg.yourcompany.com` or `replies.yourcompany.com`), enter only the subdomain part (e.g., `mg` or `replies`).
0
3
Enter the TXT Value (Record) — In the Record field, paste the following exact value: `v=spf1 include:mailgun.org ~all`. This value is standard for all Mailgun SPF records.
4
Save the Record — Click Add Record to save your first TXT record. This record will now appear in your domain's DNS record list.
1
⚠️ Do NOT include your root domain (e.g., `yourcompany.com`) in the 'Name' field when setting up a subdomain. Only enter the subdomain itself.
Add the Second TXT Record (DKIM)
The second TXT record is for DKIM (DomainKeys Identified Mail). DKIM adds a digital signature to your outgoing emails, allowing recipients to verify that the email truly originated from your domain and hasn't been tampered with in transit. This record is unique to your Mailgun account.
1
Select TXT Record Type Again — Click the +Add Record button once more and select Add "TXT" Record. You will now add the second TXT record.
2
Copy DKIM Hostname from Mailgun — Go to your Mailgun domain settings page. Locate the second TXT record entry, which is usually a long string starting with `krs._domainkey` or similar. Copy the entire hostname provided by Mailgun (e.g., `krs._domainkey.mg`). Only copy the part *before* your root domain.
3
Enter the Hostname (Name) — Paste the copied hostname into the Name field in HostGator. This hostname is specific to your Mailgun setup.
0
4
Copy DKIM Value from Mailgun — Return to your Mailgun domain settings. Copy the very long TXT record value associated with the second TXT entry. This value starts with `v=DKIM1; k=rsa; p=`.
5
Enter the TXT Value (Record) — Paste this long copied value into the Record field in HostGator. Ensure you copy the entire string without any extra spaces or characters.
6
Save the Record — Click Add Record to save your second TXT record. This completes the TXT record setup.
1
⚠️ Mistyping or missing any part of this long TXT record value will prevent proper email authentication.
🔥 Pro Tip
The second TXT record's hostname and value are unique to your Mailgun account. Always copy these directly from your Mailgun domain settings 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.
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
MX (Mail Exchanger) records tell other mail servers where to send incoming email for your domain. Mailgun requires two MX records to correctly handle bounce notifications and other inbound email processes related to your sending domain.
1
Select MX Record Type — Click the +Add Record button and select Add "MX" Record. This will open the fields for creating a new MX record.
0
2
Enter the Hostname (Name) — In the Name field, use the same hostname you used for your first TXT record. This will be `@` for a main domain or the subdomain (e.g., `mg`, `replies`) for a subdomain.
1
3
Set the Priority — Enter `10` in the Priority field. This priority value is standard for Mailgun MX records.
2
4
Set the Destination — In the Destination field, paste `mxa.mailgun.org`. This is the first Mailgun mail server address.
3
5
Save the Record — Click Add Record to save your first MX record.
4
⚠️ Adding Mailgun MX records to a main domain already handled by another email service (like GSuite) will cause your main email service to stop working.
🔥 Pro Tip
If you are using GSuite or another email provider for your *main* domain, ensure you are setting up Mailgun on a *subdomain*. Adding Mailgun MX records to your main domain will conflict with your existing email service.
Add the Second MX Record
You need to add a second MX record for Mailgun. This record points to a different Mailgun server, providing redundancy and ensuring reliable email handling.
1
Select MX Record Type Again — Click the +Add Record button and select Add "MX" Record once more to add the second MX entry.
2
Enter the Hostname (Name) — Use the same hostname in the Name field as you did for the previous MX record. This will be `@` or your subdomain (e.g., `mg`, `replies`).
3
Set the Priority — Enter `10` in the Priority field, matching the priority of the first MX record.
4
Set the Destination — In the Destination field, paste `mxb.mailgun.org`. This is the second Mailgun mail server address.
5
Save the Record — Click Add Record to save your second MX record. You have now completed adding both Mailgun MX records.
Add the CNAME Record for Email Tracking
The CNAME record is essential for enabling email tracking features, such as open and click tracking, within GoHighLevel. This record typically points a specific subdomain to Mailgun's tracking servers.
1
Select CNAME Record Type — Click the +Add Record button and choose Add "CNAME" Record. This prepares the fields for your CNAME entry.
2
Copy CNAME Hostname from Mailgun — Go back to your Mailgun domain settings page. Locate the CNAME record entry. Copy the hostname provided by Mailgun. For a main domain (`yourcompany.com`), this is usually `email`. For a subdomain like `mg.yourcompany.com`, it will be `email.mg`.
3
Enter the Hostname (Name) — Paste the copied CNAME hostname into the Name field in HostGator. Ensure you only copy the specific tracking part, not your full domain.
4
Enter the CNAME Value (Record) — In the Record field, paste `mailgun.org`. This is the standard destination for Mailgun's CNAME tracking record.
5
Save the Record — Click Add Record to save your CNAME record. You have now added all five required DNS records for Mailgun.
⚠️ An incorrect CNAME record will prevent GoHighLevel from accurately tracking email opens and clicks.
Verify Your DNS Settings in Mailgun
After adding all five DNS records in HostGator, the final step is to tell Mailgun to check your domain's DNS. This confirms that all records are correctly configured and propagating.
1
Return to Mailgun — Navigate back to your domain's settings page within your Mailgun account. This is the same page where you copied the record values.
2
Initiate DNS Verification — Click the Verify DNS Settings button. Mailgun will now attempt to detect the records you just added.
3
Re-verify if Needed — If some records do not immediately show a green checkmark, wait a few minutes (or up to a few hours for DNS propagation) and click Verify DNS Settings again. DNS updates can take time to become active across the internet.
4
Integrate with GoHighLevel — Once all records show a green checkmark, your Mailgun domain is verified. You can now proceed to find your Mailgun API key and add it to your GoHighLevel account under Settings → Email Services.
⚠️ Mailgun will not function correctly with GoHighLevel until all DNS records are successfully verified.
🔥 Pro Tip
After successful verification, send a test email from GoHighLevel's Conversations tab to confirm that your Mailgun integration is fully functional.
Troubleshooting Common Issues
⚠️ Mailgun records are not verifying (red X or yellow warning).
First, wait for DNS propagation; this can take up to 48 hours. Double-check each record in HostGator for typos in the hostname, record value, or priority. Ensure no extra spaces are present. Then, re-click Verify DNS Settings in Mailgun.
⚠️ Emails are not sending from GoHighLevel after Mailgun setup.
Verify that your Mailgun API key is correctly entered in GoHighLevel under Settings → Email Services. Ensure your Mailgun domain is marked as 'Active' in your Mailgun account and that all DNS records are verified.
⚠️ My existing email service (e.g., GSuite) stopped working after adding Mailgun MX records.
If you use your main domain for another email service, you must use a *subdomain* (e.g., `mg.yourdomain.com`) for Mailgun. Revert Mailgun MX records from your main domain if they conflict with your primary email provider's MX records. Re-add Mailgun MX records to your chosen subdomain instead.
⚠️ I'm confused about the hostname for my subdomain in HostGator.
For a subdomain like `mg.yourdomain.com`, the hostname in HostGator should be `mg`. For `replies.yourdomain.com`, it should be `replies`. Do not include the root domain in this field. For the main domain, use `@`.
⚠️ The second TXT record (DKIM) or CNAME record hostname seems incorrect.
These specific hostnames are unique to your Mailgun setup. You *must* copy them directly from your Mailgun domain settings page. Do not guess or modify them.
Common Mistakes to Avoid
→Including the root domain (e.g., `yourdomain.com`) in the 'Name' or 'Hostname' field for subdomain entries in HostGator.
→Not waiting long enough for DNS propagation (up to 48 hours) before repeatedly trying to verify records in Mailgun.
→Confusing the values or hostnames for the first TXT (SPF) and second TXT (DKIM) records.
→Adding Mailgun MX records to a main domain that is already actively used by another email provider like GSuite, causing email conflicts.
→Forgetting to click the 'Verify DNS Settings' button in Mailgun after adding all the records in HostGator.
Frequently Asked Questions
QHow long does it take for DNS records to propagate after I add them in HostGator?
DNS propagation can vary significantly, taking anywhere from a few minutes to up to 48 hours. This delay is a normal part of how the internet updates domain information. If your Mailgun records don't verify immediately, wait a few hours and then try clicking 'Verify DNS Settings' again.
QCan I use my main domain for Mailgun if I already have it set up with GSuite or another email service?
It is strongly recommended to use a subdomain (e.g., `mg.yourdomain.com` or `replies.yourdomain.com`) for Mailgun if your main domain is already used by another email service like GSuite. This prevents direct conflicts with your existing MX records, which could disrupt your primary email service.
QWhat should I do if Mailgun isn't verifying my DNS records even after waiting?
First, meticulously double-check all five records (two TXT, two MX, one CNAME) in your HostGator Zone Editor for any typos in the hostname, record value, or priority. Ensure no extra spaces are present. Confirm you've waited sufficient time for propagation, then click 'Verify DNS Settings' again in Mailgun.
QWhere exactly do I find the specific record values for the second TXT (DKIM) and CNAME records?
The second TXT record (DKIM) value and hostname, along with the CNAME record's hostname, are unique to your specific Mailgun domain setup. You must log into your Mailgun account, navigate to your domain settings, and copy these exact values directly from the Mailgun interface.
QWhat is the specific purpose of each of the five DNS records I need to add for Mailgun?
The first TXT record (SPF) authenticates your domain for sending emails, reducing spam. The second TXT record (DKIM) digitally signs your emails to prevent tampering and verify authenticity. The two MX records direct incoming email for your Mailgun domain, handling bounces and replies. The CNAME record enables crucial email tracking features like open and click tracking.
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.
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
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.