2

So I bought a new domain name from GoDaddy and pointed the domain to my VPS IP Address which works fine.

[Please note, the VPS is not hosted with GoDaddy, just the domain name.]

However, I noticed that all incoming mails from external servers (gmail, yahoomail, other domains, etc) keep bouncing back even though outcoming emails (from my domain to other mail servers work fine).

After googling the issue out, it seems that I need to make changes to my domain's MX Records in order to be able to send/receive mail.

In GoDaddy, the mx records are as follows:

10  @   mailstore1.secureserver.net 1 Hour  
0   @   smtp.secureserver.net   1 Hour

What I have tried so far:

  1. So as instructed by online tutorials and forums, I created an A Record mail.abcd.com and pointed it to my VPS IP Address.

  2. After that, I added this line to the list of MX Records:

    1 @ mail.abcd.com 1 hour

So now it looks like this:

10  @   mailstore1.secureserver.net 1 Hour  
0   @   smtp.secureserver.net   1 Hour
1   @   mail.abcd.com   1 Hour

[I have replaced my domain with abcd.com in the above snippet]

However, I still can't send anything to any email hosted in my server.

What am I doing wrong?

AndrewL64
  • 169
  • 17
  • what's the output of dig MX abcd.com ? and are there A records for mail.abcd.com and other MX records ? – Lazy404 Jun 02 '16 at 22:07
  • @Lazy404 Should I run that on SSH or somewhere else? – AndrewL64 Jun 02 '16 at 22:08
  • any linux box with dig installed will do – Lazy404 Jun 02 '16 at 22:09
  • I get this: abcd.com. 3599 IN MX 10 mailstore1.secureserver.net. abcd.com. 3599 IN MX 0 smtp.secureserver.net. abcd.com. 3599 IN MX 1 mail.abcd.com. – AndrewL64 Jun 02 '16 at 22:11
  • Copied the result here: https://jsfiddle.net/AndrewL32/e0d8my79/126/ – AndrewL64 Jun 02 '16 at 22:12
  • If `abcd.com` is your idea of a sensibly-redacted domain name, please (a) read [our guide on what and how to redact](http://meta.serverfault.com/questions/963/what-information-should-i-include-or-obfuscate-in-my-posts), and (b) give us the real domain name. – MadHatter Jun 02 '16 at 22:16
  • @MadHatter Domain name info updated. – AndrewL64 Jun 02 '16 at 22:18
  • Thank you for that, but you still haven't told us *your* domain name - the most important piece of information. Is it `shillong.work`? – MadHatter Jun 02 '16 at 22:19
  • Oh and yes, I'm using the latest cPanel/WHM on the VPS if that makes any difference. – AndrewL64 Jun 02 '16 at 22:22
  • Let's overlook the cpanel thing for a moment, since that is pretty much grounds for closing the question all by itself. Which of the many servers you've listed in your `MX` is your shiny new mail server, the one to which you want the internet to send email for `shillong.work`? Is it `mail.shillong.work`, aka `server.khublei.com`? – MadHatter Jun 02 '16 at 22:24
  • You mean the vps IP that I'm pointing `mail.shillong.work` to? It's `173.254.231.119` – AndrewL64 Jun 02 '16 at 22:26
  • What's the exact content of bounce message ? – Lazy404 Jun 02 '16 at 22:29
  • I got this: https://jsfiddle.net/AndrewL32/e0d8my79/127/ – AndrewL64 Jun 02 '16 at 22:34
  • 2
    Thanks, that confirms my theory that mail's being handed off to `smtp.secureserver.net`, which doesn't know what to do with it. – MadHatter Jun 02 '16 at 22:35
  • See MadHatter's answer. Your mail is getting delivered to the wrong server. You should remove the two ".secureserver.net" MX records for your domain. – Massimo Jun 02 '16 at 22:35

1 Answers1

6

The problem seems to be that you have other servers than your mail server listed in your MX record, one of which has a lower priority. MX records work on a lowest-priority-first basis, which means the internet is first of all trying to send mail for your domain to smtp.secureserver.net., which doesn't seem to know anything about your domain. At this point, delivery fails fatally, and there's an end of it; your server, being listed at second priority, will never get tried.

The only mail servers you should list in your MX records are those that either (a) are prepared to accept email for your domain, for final delivery, or (b) are prepared to accept email for your domain with a view to delivering it on to a final delivery server, and are specifically configured to do so.

If you overhaul the MX record for shillong.work to something like

shillong.work.          3600    IN      MX      10 mail.shillong.work.

and remove all other MX records, then wait an hour (for the 3600s TTL to expire), the internet should start delivering your inbound mail to your server.

MadHatter
  • 78,442
  • 20
  • 178
  • 229