By erel
I have a domain name mydomain.com
, which is handled by DigitalOcean DNS. I want
each email sent to support@mydomain.com
, to arrive at my gmail mailbox at mygmailaccount@gmail.com
. I went to my DNS page, to the MX tab, and clicked “Add Gmail MX records”, which added 5 MX records. But, I did not find anywhere a place to enter the target gmail mailbox.
How can I set-up my DNS so that all email sent to support@mydomain.com
arrives at mygmailaccount@gmail.com
?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi there Erel,
In your case you will have to use a combination of MX records (which direct where emails sent to your domain should go) and email forwarding rules (which specify which mailbox the email should end up in).
The MX records you added from DigitalOcean would only tell the world that Google is the handler of the emails for your domain, but you need more configurations to direct emails to a specific Gmail account.
What you would need to do is:
You’ve already done this step. By adding the Gmail MX records, you’re instructing that emails sent to @mydomain.com
should be routed through Google’s email servers.
You can’t directly set up email forwarding through DNS records. Instead, you need an intermediary service to capture the email and then forward it to your Gmail address.
There are a couple of ways to handle this:
Setup a Mail Server: If you don’t have a mail server already, you’ll need to set up one for mydomain.com
. There are solutions like Postfix, Exim, etc., which can handle this. Setting up a mail server can be complex, so if you’re not familiar with this, it might be a challenging step, here is a good article that covers why you might not want to run your own email service:
https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-server
Email Forwarding: Once your mail server is up and running, you’ll set up a rule to forward emails from support@mydomain.com
to mygmailaccount@gmail.com
.
Instead of setting up a mail server yourself, you can use third-party email forwarding services. Services like ImprovMX, ForwardMX, or Pobox allow you to forward emails from your domain to your Gmail account without needing to set up a mail server.
For most of these services:
support@mydomain.com
should be forwarded to mygmailaccount@gmail.com
.Once you’ve set up email forwarding, emails will be sent to your Gmail. However, Google might classify these forwarded emails as spam since they’re relayed through different servers.
Create a Filter: To avoid emails being marked as spam, you might want to set up a filter in Gmail. Go to Gmail settings → Filters and Blocked Addresses → Create a new filter. You can set the filter to recognize emails sent to support@mydomain.com
and then mark them as “Not spam”.
Send As: If you want to send emails from Gmail as support@mydomain.com
, you can set this up in Gmail settings under “Accounts and Import” → “Send mail as” → “Add another email address”.
An alternative option is to use Google’s business email service which let’s you use a custom domain name:
Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.