Set up DNS for Mailgun
To use Mailgun with a custom domain, you need to add specific DNS records to your domain's DNS configuration. This allows Mailgun to send and receive emails on behalf of your domain.
mail2dns is the fastest way to create the DNS records. You can use mail2dns with the supported DNS providers listed below to create the necessary records in one command.
CLI Usage
mail2dns setup <your-domain> mailgun <dns-provider> Supported DNS Providers
Follow the relevant setup guide for using mail2dns to set up your DNS configuration for Mailgun
Is your DNS provider missing? Let us know
DNS records required for Mailgun
Mailgun requires the following DNS records to send and receive email from your domain. These are created automatically by the mail2dns setup command:
TXT Record
@ → v=spf1 include:mailgun.org ~all
TXT Record
mx._domainkey → {DKIM_TXT}
TXT Record
_dmarc → v=DMARC1; p=none;
MX Record
@ → mxa.mailgun.org
MX Record
@ → mxb.mailgun.org
CNAME Record
email → mailgun.org