-1

I am having some serious problems setting up the proper DNS addresses for my domain.

My DNS records are like

mail              A         ip1 (shared hosting provider)
mail              A         ip2 (VPS mail server)
info              A         ip2
mail.info         CNAME     domain.com
info.domain.com   MX    5   mail.info

Now, from server 2. I am able to send emails but when someone replies to the email then I am not receiving the email. there might be some issues in these above DNS records. can someone please help me figure it out?

Stuggi
  • 3,506
  • 4
  • 19
  • 36
dipak4776
  • 1
  • 1
  • You're going to want to start by looking to your mail server logs for more information on the problems. – Bert Oct 14 '20 at 16:40
  • 1
    Please don't use `domain.com` but `example.com` when you obfuscate things. Better: do not obfuscate and give real names which will prompt far better answers. – Patrick Mevzek Oct 14 '20 at 17:10

1 Answers1

1

The way you've set that up translates to the following:

A server that tries to send email to somebody@info.domain.com opens a connection to mail.info, which in itself is a CNAME for domain.com.

If you want Server2 (which I assume has the IP ip2) to receive email sent to somebody@info.domain.com, you'll need to change that record to point to mail.domain.com

But you also have 2 records for mail.domain.com, which means that the DNS server will round-robin load balance between those records, so incoming mail will randomly be sent to either ip1 or ip2, which is probably not what you want.

Here's how you'd usually set this up:

mail              A         1.2.3.4 (mail server)
domain.com.       MX    5   mail.domain.com

Do note that if you add multiple MX records for a domain, it's assumed that any of those servers are responsible for any mail sent to that domain. And any particular email is only sent to a single mail server, not to every mail server listed in DNS.

EDIT:

Here's how I would configure it based on the comments below:

mail1             A         ip1 (shared hosting provider)
mail2             A         ip2 (VPS mail server)
info              A         ip2
domain.com        MX    5   mail1
info.domain.com   MX    5   mail2
Stuggi
  • 3,506
  • 4
  • 19
  • 36
  • I want it like if someone send an email to somebody@domain.com then it must be handled by ip1. And if someone send an email to somebody@info.domain.com then it must be handled by ip2. How can I set it up that way ? – dipak4776 Oct 15 '20 at 00:40
  • still, I am unable to receive email on somebody@info.domain.com.I have updated the dns addresses as you have told. I am using virtualmin on linux. I am unable to figure out what is the real problem. – dipak4776 Oct 16 '20 at 15:54