MX record for subdomains?

  • Posted October 4, 2014

Is there any way with DigitalOcean DNS to create an MX record for a subdomain?

Our email is handled by Gmail, so we have the standard MX records:


However, we also process incoming email through our application via Mandrill ( This requires a separate subdomain (e.g., for which we’d need subdomain-specific MX records.

There doesn’t seem to be a way to specify a subdomain name on the DigitalOcean DNS control panel. Am I mistaken, or am I going to have to use a separate managed DNS provider (e.g. or AWS Route53)?

Thanks, Anthony


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I finally figured it out: put in your fully qualified subdomain as a new domain in your DNS settings, as if you were setting up an entirely new domain. ( You can then set the MX records from there.

+1 for adding sub-domain MX records. We had a news letter setup when we migrated it does not work now, because it was configured for a sub-domain. You inbond emails are handled by gmail. Any detailed tutorials on how to get this working (work-around) ?

Found out that you can actually set the subdomain mx record via the api, it also gets displayed correctly in the zone file but not in the interface itself.

I ended up here because I need to add MX records for Mailgun. I am saddened because this feature, although it doesn’t seem on the surface like it would be difficult to add, doesn’t exist, and there doesn’t appear to be any desire to add it. Your DNS manager is beautiful, and would be my preferred choice, over GoDaddy, ZoneEdit, Google, Gandi, or whatever. I humbly ask that this be place on your todo list.



You can’t do this in the UI, but you can in the API:

curl -X POST -H “Content-Type: application/json” -H “Authorization: Bearer API_KEY_HERE” -d ‘{“type”:“MX”,“name”:“SUBDOMAIN.”,“data”:“”,“priority”:10,“port”:null,“weight”:null}’ “

Note this is all one line, and name goes in the subdomain. Don’t include your domain in that or it will duplicate it.

Hey guys, I have the same problem and I’m using CloudFlare as DNS server, and it does not allow me to add the subdomain as a new domain in CloudFlare.

+1. Another user of Mailgun


+1 for this!

Hi jcheroske, as davidmarshalljr said in the first answer, it is possible to create a new domain from scratch, in the main DNS window (instead or use as domain name), and then inside it you can add MX and TXT records for mailgun, I have modified it right now and it seems to work.