How I Use My Private Domain for Email with ImprovMX, Mailgun, DynuDNS, and Ghost CMS

Managing your own email on a private domain is a rewarding way to personalize your online presence. In this post, I'll walk through my setup, which combines ImprovMX for forwarding, Mailgun for sending and newsletters, and DynuDNS for flexible DNS management-including both wildcard and MX records. I'll also cover integrating Mailgun with Ghost CMS for seamless mailing list and newsletter functionality.
This solution is almost free, I did have to buy the base membership for DynuDNS because I had so many different records, and the free level restricts you to approximately four.
Why This Setup?
- Custom branding: Use your own domain for all email.
- Reliability: Forwarding and sending handled by robust third-party services.
- Flexibility: DynuDNS keeps DNS records up-to-date, even with dynamic IPs.
- Mailing lists/newsletters: Ghost CMS + Mailgun for subscriber management and bulk email.
Step 1: Register and Configure Your Domain
Start by registering your domain with your preferred registrar. I use DynuDNS as my DNS provider, which allows dynamic updates to all record types-including A, CNAME, and crucially, MX records.
Step 2: Set Up DynuDNS for Wildcard and MX Records
DynuDNS isn’t just for A records. I use it to:
- Maintain wildcard DNS entries (
*.mydomain.com
) for development and subdomains. - Dynamically update MX records for both ImprovMX and Mailgun. This means if I ever need to change MX endpoints or my home IP changes (for self-hosted services), I can update them instantly without waiting for slow DNS propagation elsewhere.
Example MX Records in DynuDNS:
Host | Type | Priority | Value | Purpose |
---|---|---|---|---|
@ (root) | MX | 10 | mx1.improvmx.com | ImprovMX |
@ (root) | MX | 20 | mx2.improvmx.com | ImprovMX |
mg.mydomain.com | MX | 10 | mxa.mailgun.org | Mailgun |
mg.mydomain.com | MX | 20 | mxb.mailgun.org | Mailgun |
Step 3: Configure ImprovMX for Email Forwarding
ImprovMX lets you receive emails at your domain and forwards them to your chosen inbox (like Gmail or ProtonMail).
How to set up:
- Sign up at ImprovMX and add your domain.
- Follow their guide to add the required MX records in DynuDNS (see above).
- Add an SPF TXT record:
v=spf1 include:spf.improvmx.com ~all
- Optionally, set up DKIM and DMARC for better deliverability.
- Create aliases (e.g.,
me@mydomain.com
→ your Gmail address - https://improvmx.com/guides/gmail-smtp).
Step 4: Set Up Mailgun for Sending Email
Mailgun is my choice for sending bulk emails (newsletters) from my domain, otherwise I leverage the alias functionality within Gmail.
Steps:
- Create a Mailgun account.
- Add your domain or a subdomain (like
mg.mydomain.com
) in Mailgun. I found it best to use a subdomain, so that you can distinguish between ImprovMX and Mailgun MX configurations. - Mailgun will provide DNS records (MX, SPF, DKIM, CNAME) to add to DynuDNS.
- Once verified, you can use Mailgun’s SMTP or API for sending.
Step 5: Integrate Mailgun with Ghost CMS for Mailing Lists
Ghost CMS supports Mailgun for both transactional and bulk (newsletter) emails. For newsletters, Ghost requires the Mailgun API-not just SMTP.
How to connect:
- In Ghost Admin, go to Settings > Email newsletter > Mailgun configuration.
- Enter your Mailgun domain, region, and Private API Key.
- Set your sender address (e.g.,
newsletter@mydomain.com
). - Save and test by sending a test email.
Now, every time you publish a newsletter in Ghost, it will be delivered to your subscribers via Mailgun’s high-deliverability infrastructure.
Step 6: Sending and Receiving from Your Domain
- Receiving:
All incoming mail to@mydomain.com
is forwarded by ImprovMX, with MX records managed by DynuDNS. - Sending:
Outgoing mail (including Ghost newsletters) is sent via Mailgun, again with MX and SPF/DKIM records managed in DynuDNS, for automated emails from Ghost, or as an alias via Gmail inbox
Benefits of Using DynuDNS for MX Records
- Dynamic updates: Instantly change MX records for ImprovMX or Mailgun if endpoints change, or if you migrate to different providers.
- No downtime: Email delivery isn’t interrupted by slow DNS propagation.
- Centralized control: All DNS records-A, MX, CNAME, TXT-are managed from one dashboard.
Tips and Best Practices
- Always verify your DNS changes with each provider (ImprovMX and Mailgun both offer verification tools).
- Use SPF, DKIM, and DMARC records for both ImprovMX and Mailgun to maximize deliverability and prevent spoofing.
- For Ghost CMS, use Mailgun’s API (not just SMTP) for newsletters to ensure reliable bulk delivery.
- Test both sending and receiving before rolling out to your audience.
Summary Table
Function | Service | DNS Records Managed by DynuDNS | Purpose |
---|---|---|---|
Email Receiving | ImprovMX | MX, SPF, DKIM, DMARC | Forward mail to your inbox |
Email Sending | Mailgun | MX, SPF, DKIM, CNAME, DMARC | Transactional and newsletter sending, but I primarily use it for bulk/newsletters |
Wildcard DNS | DynDNS | A, CNAME | Subdomains, catch-all addresses |
Conclusion
By combining DynuDNS for DNS management (including MX), ImprovMX for forwarding, and Mailgun for sending, you get a powerful, flexible, and reliable email setup on your private domain. Integrating Mailgun with Ghost CMS lets you run newsletters and mailing lists with ease, all under your own brand.
If you want to take control of your email and newsletter experience, this approach is robust, scalable, and future-proof.
Sources:
- https://improvmx.com
- https://improvmx.com/guides/gmail-smtp
- https://forum.ghost.org/t/email-newsletter-with-mailgun/11279
- https://improvmx.com/guides/
- https://forum.ghost.org/t/how-setup-email/45470
- https://www.mailgun.com/resources/videos/getting-started-with-mailgun
- https://forum.ghost.org/t/setting-up-mailgun/35723
- https://forum.ghost.org/t/configuring-mailgun/37900
- https://ghost.org/docs/faq/mailgun-newsletters/
- https://www.youtube.com/watch?v=Ju7hROyEZGs
- https://dynu.com