Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel…
5 min read1,139 words25 explained imagesUpdated Wed, 1 Jul at 7:02 AM
Assistants need to reach this page over the internet. While it is only running on your machine, these two buttons will not be able to load it.
Each image has a one line explanation. Switch to full detail for the step it belongs to, the fields and buttons involved, examples and the whole procedure.
Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.
What You'll Learn
This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two TXT records, two MX records, and one CNAME — inside HostGator's cPanel Zone Editor.
It also covers how to avoid breaking your existing Google Workspace/Gmail mail delivery while adding Mailgun's records.
Sign up at Mailgun.com, then check your inbox to verify your email address.
Sign up for Mailgun & add your domain (image 1 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 1 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Sign up for Mailgun & add your domain (image 2 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 2 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Step 2
Log in to Mailgun, then click Sending → Add New Domain.
Sign up for Mailgun & add your domain (image 3 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 3 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Step 3
If your domain is companyname.com, decide whether to set up the main domain or a subdomain with Mailgun.
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Important
Set up the domain or subdomain under the US region — not EU.
Click Add domain.
Sign up for Mailgun & add your domain (image 4 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 4 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Tip
The next screen asks you to add DNS records to your domain. Leave this screen open — you'll need it for the next step.
Sign up for Mailgun & add your domain (image 5 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Sign up for Mailgun & add your domain" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 5 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
2Access DNS records in cPanel
Now log in to your DNS records and add the 5 DNS records Mailgun requires. This guide uses HostGator's cPanel as the example.
Look for the Domains section, then click Zone Editor.
Access DNS records in cPanel (image 6 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Access DNS records in cPanel" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Access DNS records in cPanel" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 6 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Step 3
Locate your domain in the Zone Editor section, then click its Manage button to view the domain's complete set of DNS records.
Access DNS records in cPanel (image 7 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Access DNS records in cPanel" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Access DNS records in cPanel" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 7 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Step 4
Click the +Add Record button and select Add "TXT" Record.
Access DNS records in cPanel (image 8 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Access DNS records in cPanel" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Access DNS records in cPanel" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 8 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
3Add the 1st TXT record (SPF)
Add the 1st TXT record (SPF) (image 9 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 1st TXT record (SPF)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 1st TXT record (SPF)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 9 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Fields
A. Name: different for everyone — do not include the root domain.
mg.companyname.com → host name is mg
replies.companyname.com → host name is replies
Main domain (companyname.com) → host name is @
B. Record: the same for everyone — paste v=spf1 include:mailgun.org ~all.
Add the 1st TXT record (SPF) (image 10 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 1st TXT record (SPF)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 1st TXT record (SPF)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 10 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
C. Click Add Record.
4Add the 2nd TXT record (DKIM)
Click the +Add Record button and select Add "TXT" Record again.
Add the 2nd TXT record (DKIM) (image 11 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 11 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Add the 2nd TXT record (DKIM) (image 12 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 12 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Fields
A. Name: this part is a little tricky. Copy everything from the beginning of the value up until the subdomain part — do not include the root domain. Everyone's 2nd TXT record name and record value are different.
Example
Host name to copy
Highlighted part
Using a subdomain
mx._domainkey.helpdesk
Add the 2nd TXT record (DKIM) (image 13 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 13 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Using the main domain
mailo._domainkey
Add the 2nd TXT record (DKIM) (image 14 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 14 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
B. Record: different for everyone. Head back to Mailgun and copy the 2nd, much longer TXT record — highlighted in the screenshot below — and paste it here.
Add the 2nd TXT record (DKIM) (image 15 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd TXT record (DKIM)" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 15 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
C. Click Add Record.
5Add the 1st MX record
Add the 1st MX record (image 16 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 1st MX record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 1st MX record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 16 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Click the +Add Record button and select Add "MX" Record.
Add the 1st MX record (image 17 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 1st MX record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 1st MX record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 17 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Add the 1st MX record (image 18 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 1st MX record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 1st MX record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 18 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Fields
A. Name: different for everyone —
mg.companyname.com → host name is mg
replies.companyname.com → host name is replies
Main domain → host name is @
B. Priority: 10 — the same for everyone, no matter what domain you're setting up.
C. Destination: the same for everyone — paste mxa.mailgun.org.
Click Save Record.
6Add the 2nd MX record
Click the +Add Record button and select Add "MX" Record again. This time we'll add a second record pointing to mxb.mailgun.org.
Add the 2nd MX record (image 19 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd MX record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd MX record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 19 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Add the 2nd MX record (image 20 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the 2nd MX record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the 2nd MX record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 20 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Fields
A. Name: different for everyone —
mg.companyname.com → host name is mg
replies.companyname.com → host name is replies
Main domain → host name is @
B. Priority: 10 — the same for everyone.
C. Destination: the same for everyone — paste mxb.mailgun.org.
Click Save Record.
7Add the CNAME record
Add the CNAME record (image 21 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 21 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Click the +Add Record button and select Add "CNAME" Record.
Add the CNAME record (image 22 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 22 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Add the CNAME record (image 23 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 23 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Fields
A. Name: different for everyone. Head back to Mailgun to copy the host name — copy everything from the beginning up until the subdomain part, do not copy the main domain.
mg.companyname.com → host name is email.mg
replies.companyname.com → host name is email.replies
Main domain (companyname.com) → host name is email
Add the CNAME record (image 24 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Add the CNAME record" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 24 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
B. Record: the same for everyone — paste mailgun.org.
C. Click Save Record.
8Verify DNS & finish setup
Now that you've added all 5 records, go back to Mailgun and click Verify DNS Settings. If some records still aren't showing a green checkmark, click the same button again — DNS propagation can take a little time.
Verify DNS & finish setup (image 25 of 25)What this shows Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel.What this showsIllustrates the "Verify DNS & finish setup" section of "MailGun Setup - HostGator Domain Setup".This screenshot appears in the "Verify DNS & finish setup" section of "MailGun Setup - HostGator Domain Setup". For context, this section explains: Email Infrastructure Mailgun + HostGator Domain Setup Step-by-step DNS configuration for connecting Mailgun to a domain hosted with HostGator's cPanel. What You'll Learn This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two…. This part of the guide covers 7 fields, listed below.Image 25 of 25
Fields in this part of the guidemg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referencedSending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDomainsZone EditorManage+Add RecordAdd "TXT" Recorddo not include the root domain.mg
Example values
Main domain (companyname.com) → host name is email
priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Log in to cPanel, look for the Domains section, and click Zone Editor. From there, find your domain and click Manage to view and add DNS records.
Q: Should I use my main domain or a subdomain with Mailgun?
If you already use your main domain with Google Workspace or another email provider, use a subdomain (like mg.companyname.com) for Mailgun instead to avoid mail routing conflicts.
Q: What does "do not include the root domain" mean for the Name field?
In cPanel's Zone Editor, the Name field only needs the subdomain portion — the root domain is added automatically. So for mg.companyname.com, you'd enter just "mg", not the full domain.
Q: Will this break my existing Gmail or Google Workspace email?
Not if you use a subdomain for Mailgun rather than your main domain, and leave your existing MX records for Google Workspace untouched on the main domain.
Q: How long does it take for DNS records to verify?
DNS propagation is usually fast, but it can occasionally take a few hours. If a record isn't showing green yet, wait a bit and click Verify DNS Settings again.
Q: What do I do after all 5 records show a green checkmark?
Grab your Mailgun API key, add it to your email service settings, and send a test email in a conversation to confirm delivery is working.