Score:0

Adding MX record

ng flag

I would want to achieve the following: I have acquired a domain name, and I would like to add a website and a mail server for this domain. I have: 1 Domain name, 1 private Ubuntu server with IP, 1 hosting provider (Vercel).

For the website, I am hosting it on Vercel, and configured the DNS servers on my domain name to use Vercel's, which works just fine.

As for the email, I would like to use my own private server on Digital Ocean, basically an Ubuntu box that I SSH into. I could add a MX entry on Vercel and point it to a domain name in charge of the mail server, HOWEVER I only have an IP address of my private server that I want to use as the mail server. As per the MX specification - the MX has to be a domain name and not an IP address.

Considering this scenario, what is the best solution to this issue?

Thanks in advance.

Score:0
vn flag

The first step is that you create an A record (probably enough to simply name it mail, and your DNS provider will expand that to mail.yourdomain.tld) that points to your Ubuntu box at Digital Ocean. You can also create an AAAA record if you want your Ubuntu box to handle IPv6 connections. There is no need for the A or AAAA records you put in your zone file at Vercel to only refer to servers in Vercel.

Once you have done that, you simply create your MX record in Vercel's DNS pointing to mail.yourdomain.tld and you're set. Though I'd look at DKIM/DMARC and SPF as well.

user3047450 avatar
ng flag
Thanks for the advice! Just to clarify one thing, that is unclear to me: On Vercel I already have an A record, used for the website hosting. This makes sense because I am hosting my site on Vercel. From what you wrote, I should add another (a second one) A record pointing to my private Ubuntu server IP address. Is this correct? If so, since I am not hosting the website on my private Ubuntu server, wouldn't that cause an issue? Essentially pointing two A records : one to Vercel running the website, and another A record to my Ubuntu box who is NOT running any website, only a mail server.
tsc_chazz avatar
vn flag
Your assumption is correct, you are adding a second A record, one that points to your Ubuntu machine... but it is a different A record specifying a different name. Your existing A record would be `yourdomain.tld`, for instance, the new one is `mail.yourdomain.tld`. If someone was to browse to `mail.yourdomain.tld` they'd get nothing - your Ubuntu box presumably isn't serving web - but why would they? You haven't set any links that point to `mail.yourdomain.tld` anywhere.
user3047450 avatar
ng flag
That makes sense. Thanks for the help!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.