0

I am trying to spin up my own mail server (mail-in-a-box because it seemed simple) for myDomain.com. I spun up a Linode server & got port 25 open and mapped box.myDomain.com to redirect me to the mail-in-a-box server correctly.

From box.myDomain.com/mail I am able to sign in to the mail service. I can send emails to any address local on the server or randomguy@gmail.com.

However, I run into problems because I can't reply to user@myDomain.com even though that is the email. I have tried setting up mx record to point traffic from @myDomain.com to the box.myDomain.com but it isn't working.

Current DNS records:

type    name  content 
MX      @     0  x.x.x.x
A       mx    x.x.x.x
A       box   x.x.x.x   //I forgot to include this because there are 25 entreis and just forgot it. 
A       @     y.y.y.y
MX      box   0 box.myDomain.com
  • y.y.y.y is the server that is currently up and running.
  • x.x.x.x is the server that is up for my email. There are others

I am not sure if some of these are redundant or not as this is my first time setting up DNS.

Any help would be appreciated.

EDIT on HOW I fixed it I got confused with Domain.com's way of handling MX records because there is a priority field & the examples I found of the MX records were of the priority in the content field. I had to move the 0 to the priority and only have x.x.x.x in the content and it seems to be working now.

  • Can you elaborate more on the DNS configuration?. It would be helpful to know which are the records of type A, MX and TXT (SPF) involved (including TTL fields). – J.M. Robles Jan 11 '20 at 16:06
  • You shouldn't have two MX records with the same priority. You can leave one as 0 and the other e.g. as 10. Realize that it's a master & backup priority. The master will always be used, if not available the next one is used based on priority – aardbol Jan 11 '20 at 17:15
  • I updated the DNS records. I am not sure how long it will take to update but as of right now it is still not working. – Noah Franck Jan 11 '20 at 19:53
  • @EarthMind Actually that's not true in this case. The other mx record is for a subdomain. I'm not saying the current dns-setup works, but just that you can have multiple MX records with 0 prio if they're for other subdomains. – Xzenor Jan 11 '20 at 21:55
  • @NoahFranck you should be able to set the Time To Live (TTL) of every DNS record. It's the amount of seconds the record is remembered. You may want to set it to 300 (5 minutes) maybe while testing with DNS so you don't have to wait ages for the dns-cache to expire (cache = remembered stuff) after every change you make. Be sure to set it to at least 3600 once you have it all working though. It's bad internet etiquette to have a small TTL if you don't need it. – Xzenor Jan 11 '20 at 22:04
  • MX record type shoudl point to FQDN and not IP ;-). Change it to box.myDomain.com. – Kamil J Jan 12 '20 at 14:37

2 Answers2

1

DNS setup:

type name content

MX @ 10 box.myDomain.com.

A box x.x.x.x

Then test it with https://mxtoolbox.com/

Vadim
  • 596
  • 3
  • 10
  • mxtoolbox. of course! I should have added that to my answer as well.. Why didn't I think of this? I use it multiple times a week... funny how you can forget the obvious stuff. – Xzenor Jan 11 '20 at 22:10
0

In your example, the first MX record points to an IP address. This is not allowed and a lot of mailservers refuse it. Otherwise that might have worked. the rest is a mess though.

box.mydomain.com doesn't exist, all you have is an mx record for box.mydomain.com pointing to box.mydomain.com There's no A record or CNAME linking box.mydomain.com to an ip address.

From box.myDomain.com/mail I am able to sign in to the mail service.

Well with those DNS records that's impossible unless you're doing it on the server itself or fiddled with a host file somewhere.

Also, the last mx record makes sure something@box.mydomain.com is delivered at box.mydomain.com (which can't be resolved). something@mydomain.com (without box) is delivered at whatever is entered at the first record in your example.

So, how this is supposed to work: you create an A record for the IP address of the mailserver. Let's use 123.123.123.123 as IP and box.mydomain.com as the name.

type: A
Name: box
Value: 123.123.123.123

this makes sure box.mydomain.com will resolve to 123.123.123.123.
Then comes the MX record.

Type: MX
Name: @
Priority: 0
Value: box.mydomain.com.

MX records tell mailservers what server to dump the email to. So this tells whoever emails to noah@mydomain.com that email should be delivered to the server called box.mydomain.com. Then the name has to be resolved to an IP address so the A record gets looked up and the answer will be 123.123.123.123.

That's basically it.

Xzenor
  • 131
  • 5