Skip to content
Email

Step-by-step guide to set up Mailgun

EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test…

3 min read775 words6 explained imagesUpdated Wed, 1 Jul at 6:48 AM
View as markdownOpen in ClaudeOpen in ChatGPT
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.
On this page
  1. Sign Up for Mailgun
  2. Verify Your Email Address
  3. Add a New Sending Domain
  4. Choose a Main Domain or Subdomain
  5. Add Your DNS Records
  6. Get Your API Key & Send a Test Email
  7. Frequently Asked Questions
EMAIL INFRASTRUCTURE
Mailgun Step-by-Step Setup Guide
Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email.
What You'll Learn

This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a subdomain, publishing the required DNS records, and confirming everything works with a test email.

1Sign Up for Mailgun

Create your Mailgun account by visiting signup.mailgun.com/new/signup.

2Verify Your Email Address

Check your email inbox for a message from Mailgun and click the verification link to confirm your account.

Verify Your Email Address (image 1 of 6) What this shows EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send… What this shows Illustrates the "Verify Your Email Address" section of "Step-by-step guide to set up Mailgun". This screenshot appears in the "Verify Your Email Address" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below. Image 1 of 6
Fields in this part of the guide mg.companyname.comreplies.companyname.comsupport.companyname.com
Buttons and menus referenced Sending → Add New Domaincompanyname.comanything_here.companyname.comUSAdd domain[provider name] DNS recordsGoDaddyNamecheapSitegroundHostGatorGoogle DomainsCloudFlare
All 3 steps in this procedure
  1. mg.companyname.com
  2. replies.companyname.com
  3. support.companyname.com
Verify Your Email Address (image 2 of 6) What this shows EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send… What this shows Illustrates the "Verify Your Email Address" section of "Step-by-step guide to set up Mailgun". This screenshot appears in the "Verify Your Email Address" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below. Image 2 of 6
Fields in this part of the guide mg.companyname.comreplies.companyname.comsupport.companyname.com
Buttons and menus referenced Sending → Add New Domaincompanyname.comanything_here.companyname.comUSAdd domain[provider name] DNS recordsGoDaddyNamecheapSitegroundHostGatorGoogle DomainsCloudFlare
All 3 steps in this procedure
  1. mg.companyname.com
  2. replies.companyname.com
  3. support.companyname.com

3Add a New Sending Domain

From your Mailgun dashboard, click Sending → Add New Domain.

Add a New Sending Domain (image 3 of 6) What this shows EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send… What this shows Illustrates the "Add a New Sending Domain" section of "Step-by-step guide to set up Mailgun". This screenshot appears in the "Add a New Sending Domain" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below. Image 3 of 6
Fields in this part of the guide mg.companyname.comreplies.companyname.comsupport.companyname.com
Buttons and menus referenced Sending → Add New Domaincompanyname.comanything_here.companyname.comUSAdd domain[provider name] DNS recordsGoDaddyNamecheapSitegroundHostGatorGoogle DomainsCloudFlare
All 3 steps in this procedure
  1. mg.companyname.com
  2. replies.companyname.com
  3. support.companyname.com

4Choose a Main Domain or Subdomain

If your domain is companyname.com, you can set up either the main domain or a subdomain with Mailgun.

Option A
Main Domain

If you add the main domain, it should not already be in use with Google Workspace or any other email provider.

Option B
Subdomain

To set up a subdomain with Mailgun, you can type anything_here.companyname.com. Examples:

  • mg.companyname.com
  • replies.companyname.com
  • support.companyname.com
Note

Set up the domain or subdomain under the US region, not EU. Once you've made your selection, click Add domain.

Choose a Main Domain or Subdomain (image 4 of 6) What this shows EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send… What this shows Illustrates the "Choose a Main Domain or Subdomain" section of "Step-by-step guide to set up Mailgun". This screenshot appears in the "Choose a Main Domain or Subdomain" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below. Image 4 of 6
Fields in this part of the guide mg.companyname.comreplies.companyname.comsupport.companyname.com
Buttons and menus referenced Sending → Add New Domaincompanyname.comanything_here.companyname.comUSAdd domain[provider name] DNS recordsGoDaddyNamecheapSitegroundHostGatorGoogle DomainsCloudFlare
All 3 steps in this procedure
  1. mg.companyname.com
  2. replies.companyname.com
  3. support.companyname.com
Setup Guide
Now let's publish the DNS records
This is the step most setups get stuck on — follow it carefully.

5Add Your DNS Records

Log in to your DNS host based on where you registered the domain, and add the 5 DNS records Mailgun provides.

Not Sure Where to Add the Records?
Step 1: Look up your domain in MXToolbox

Search your domain in MXToolbox. Only enter the domain itself — do not add "http://" in front of it.

Add Your DNS Records (image 5 of 6) What this shows EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send… What this shows Illustrates the "Add Your DNS Records" section of "Step-by-step guide to set up Mailgun". This screenshot appears in the "Add Your DNS Records" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below. Image 5 of 6
Fields in this part of the guide mg.companyname.comreplies.companyname.comsupport.companyname.com
Buttons and menus referenced Sending → Add New Domaincompanyname.comanything_here.companyname.comUSAdd domain[provider name] DNS recordsGoDaddyNamecheapSitegroundHostGatorGoogle DomainsCloudFlare
All 3 steps in this procedure
  1. mg.companyname.com
  2. replies.companyname.com
  3. support.companyname.com

Once you look up the domain, the results will show your DNS hosting provider.

Add Your DNS Records (image 6 of 6) What this shows EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send… What this shows Illustrates the "Add Your DNS Records" section of "Step-by-step guide to set up Mailgun". This screenshot appears in the "Add Your DNS Records" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below. Image 6 of 6
Fields in this part of the guide mg.companyname.comreplies.companyname.comsupport.companyname.com
Buttons and menus referenced Sending → Add New Domaincompanyname.comanything_here.companyname.comUSAdd domain[provider name] DNS recordsGoDaddyNamecheapSitegroundHostGatorGoogle DomainsCloudFlare
All 3 steps in this procedure
  1. mg.companyname.com
  2. replies.companyname.com
  3. support.companyname.com
Step 2
Check the "reported by" note

MXToolbox will show a note at the bottom naming your host, e.g. "reported by wordpress.com." Once you know your provider, you can add the DNS records in that provider's dashboard. If you're not sure where to find the DNS records area, search "[provider name] DNS records."

Based on your domain provider, use one of these step-by-step guides to add the records. If your provider isn't listed, one of these should still be a close match:

6Get Your API Key & Send a Test Email

Once all of your DNS records are added and verified, grab your key from Mailgun API Key: Where to Find It in Mailgun and Add It to the Platform.

You're Almost Done

Send a test email to confirm everything works. See How to Send a Test Email in the Conversation for the steps.

7Frequently Asked Questions

Q: Should I use my main domain or a subdomain?
A subdomain (like mg.companyname.com) is usually the safer choice, since your main domain shouldn't be added if it's already in use with Google Workspace or another email provider.
Q: Why does it matter whether I choose US or EU when adding the domain?
The region determines which Mailgun infrastructure sends your mail. Always select US when setting up your domain or subdomain for this workflow.
Q: I don't know who my DNS provider is — how do I find out?
Look up your domain in MXToolbox. The results page will show a "reported by" note naming your DNS host.
Q: My domain provider isn't in the list of guides — what should I do?
Use one of the listed provider guides as a reference — the process of adding TXT, CNAME, and MX records is similar across most DNS hosts.
Q: How long does it take for DNS records to verify?
DNS propagation can take anywhere from a few minutes to 48 hours, though most records verify within an hour.
Q: My test email didn't go through — what should I check first?
Confirm all 5 DNS records show as verified in Mailgun, and double-check that your API key was entered correctly before sending another test.

Was this guide helpful?

Related guides