Mailgun Setup with HostGator DNS for Sparkforge
To connect Mailgun to a HostGator domain, add two TXT records, two MX records, and one CNAME in cPanel's DNS editor, then verify in Mailgun and send a test from Sparkforge.
Use this checklist to connect a HostGator-hosted domain to Mailgun so Sparkforge can send branded email. The HostGator DNS editor is straightforward, but a few field names differ from other registrars.
Before you start
- Sign up at mailgun.com and verify the email address.
- In Mailgun, go to Sending > Add New Domain.
- Pick a subdomain like
mg.companyname.com. Use the root domain only if no other email service is attached. - Choose the US region. Sparkforge does not read EU-region Mailgun domains.
- Click Add domain and keep the DNS instructions screen open.
Add DNS records in HostGator
Log in to HostGator and open the DNS Zone Editor for your domain.
1st TXT record (SPF)
- Type: TXT
- Name: subdomain prefix (
mg) or@for root. - Value:
v=spf1 include:mailgun.org ~all - Click Save Record.
2nd TXT record (DKIM)
- Type: TXT
- Name: copy the prefix Mailgun shows, stripping the root domain. Example:
mx._domainkey.helpdeskonly. - Value: paste the long DKIM value from Mailgun.
- Click Save Record.
1st MX record
- Click +Add Record and pick MX.
- Name: subdomain prefix or
@for root. - Priority: 10
- Destination:
mxa.mailgun.org - Click Save Record.
2nd MX record
- Add another MX record.
- Name: same as the first MX.
- Priority: 10
- Destination:
mxb.mailgun.org - Click Save Record.
CNAME record
- Click +Add Record and pick CNAME.
- Name: for
mg.companyname.comuseemail.mg; for the root domain useemail. - Record:
mailgun.org - Click Save Record.
Verify and send a test
- Return to Mailgun and click Verify DNS Settings.
- Re-click if some records are still red — propagation can take up to 30 minutes.
- Once verified, copy the Mailgun API key into Sparkforge.
- Send a test email from Conversations to confirm everything is wired up.
Frequently Asked Questions
Where is the DNS Zone Editor in HostGator?
In cPanel, scroll to the Domains section and click DNS Zone Editor (or Advanced Zone Editor on older accounts). Pick the domain you want to edit.
Why is my MX record being rejected?
Most rejections are caused by the wrong host name. Enter the subdomain prefix only (mg or replies, not the full mg.yourdomain.com) and use priority 10.
Do I need to remove HostGator's default email setup?
Only if you're configuring Mailgun on the root domain. If you use a subdomain like mg.yourdomain.com, leave the existing email DNS alone.
How long until DNS propagates?
Usually under 30 minutes for HostGator. If verification still fails after an hour, double-check the host names and value strings character by character.
Was this article helpful?
Thanks for the feedback.