Smarter eCommerce Product Management at Scale📦
June 10, 2026
This article will walk you through the full process of setting up your MailGun account in Cloudflare.
For information on how to setup a MailGun account, see article “MailGun Setup”.
If you are transferring your domain into Cloudflare from another DNS provider, please do so before continuing with this article.
Step 1: Retrieve MX and TXT records from MailGun
Log into your account in Mailgun and add a domain from the top menu bar. Once your domain is added, you will see that Mailgun gives you a few MX records and TXT records to be added for your domain, for both successful email forwarding and verification of the domain.
Step 2: Add MX and TXT records into CloudFlare
Choose your site and select DNS Settings
Step 3: Add your mail routes in MailGun
Log into your Mailgun account and go to Routes section from the top menu. Now add as many routes as you want.