MX only or MX+A for Email server? Beside, why multiple locations?

February 13, 2019 415 views
DNS Email Ubuntu 18.04 DigitalOcean

I’m trying to set up my own Email server(s). It looks I need to add 2 DNS records, one MX and one A records ??

Type     Hostname                      Value                            TTL (seconds)
* MX     longervision.com           mail.longervision.com.    10     14400
* A        mail.longervision.com   159.65.68.90                    3699

However, after I specify these 2 records, I checked Networking->Domains again:

Domains:                                                Directs to
longervision.com                                   multiple locations
2 A / 1 CNAME / 1 MX / 3 NS 

Why multiple locations? And is it OK to keep it as multiple locations?

After a while, I tried to telnet on the server:

jiapei@SERVERNAME:~$ telnet mail.longervision.com 25
Trying 159.65.68.90...
Connected to mail.longervision.com.
Escape character is '^]'.
220 mail.longervision.com ESMTP
ehlo mail.longervision.com
250-mail.longervision.com
250-SIZE 11534336
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

After a while, I tried to telnet from my laptop

➜  ~ telnet mail.longervision.com 25
Trying 159.65.68.90...
telnet: Unable to connect to remote host: Connection timed out

But, telnet hangs there…

I seriously have NO idea where I’m wrong? Can anybody give me a hand please?

2 Answers

Hey friend,

Great questions! I wouldn’t worry about the multiple locations thing, that’s not a terribly important statement at this stage. You are correct that an MX record needs to be a hostname, so if you’re running the mail server yourself you’ll need an A record and then you’ll reference that A record as the MX record. MX cannot be direct IPs, basically. They’re just alias records, much like a CNAME.

As for your laptop, I would propose that either software on the laptop is blocking port 25 or the laptop is on a network that is blocking port 25. Try from another server to that one. If it still fails, reach out to our support team and see if SMTP is blocked on your account. If so, they may have a solution for you.

https://www.digitalocean.com/company/contact/

Jarland

  • Hi, Dear Jarland:

    Thank you very much for your prompt reply....

    • I let my friend tried the same command:

      telnet mail.longervision.com 25
      

      And it’s working properly. This seems to tell: the digitalocean server is correctly set up???

    • I tried from my end

      telnet mail.longervision.com 80
      

      and it seems it’s working fine:

      ➜  ~ telnet 159.65.68.90 80
      Trying 159.65.68.90...
      Connected to 159.65.68.90.
      Escape character is '^]'.
      quit
      HTTP/1.1 400 Bad Request
      Server: nginx/1.14.0 (Ubuntu)
      Date: Thu, 14 Feb 2019 05:56:20 GMT
      Content-Type: text/html
      Content-Length: 182
      Connection: close
      <html>
      <head><title>400 Bad Request</title></head>
      <body bgcolor="white">
      <center><h1>400 Bad Request</h1></center>
      <hr><center>nginx/1.14.0 (Ubuntu)</center>
      </body>
      </html>
      Connection closed by foreign host.
      

    This seems to tell: this issue is ONLY related to port 25 ???

    • I even tried to use my cell phone 4G hotspot, instead of my home router wifi. It’s still NOT working:
    ➜  ~ telnet 159.65.68.90 25
    Trying 159.65.68.90...
    telnet: Unable to connect to remote host: Connection timed out
    ➜  ~ telnet mail.longervision.com 25
    Trying 159.65.68.90...
    telnet: Unable to connect to remote host: Connection timed out
    

    This seems to tell: it should have NOTHING to do with my router settings…

    So, I’m in a dilemma: NOTHING to do with digitalocean server, NOTHING to do with my laptop… So, what else??

    • Hard to say for sure, but here’s what I’m taking away as the variables:

      1. Telnet to 25 works from within the droplet.
      2. Telnet to 25 works when a friend tries it externally.
      3. Telnet does not work for you on local network or cellular network.

      With 2 being true, you may simply be using multiple ISPs that block port 25. Many do, it’s not an unusual situation. Otherwise it may be that your computer is blocking traffic out of port 25.

Thank you Jarland for your prompt reply. Thank you very much…

  1. FIRST of ALL:
    Please check
    https://www.digitalocean.com/community/questions/mx-only-or-mx-a-for-email-server-beside-why-multiple-locations?answer=49434

  2. I noticed that two main local Internet Service Provider, say, Telus and Shaw Cable, both blocked the port 25 in order to avoid SPAM. Details can be found at:
    TELUS HSIA Security Measures Policy
    and
    Shaw Cable: Is Port 25 (STMP) Blocked?

I wonder if there anything else that I can do for my DigitalOcean Email Server setup?

Thank you very much
Pei

Have another answer? Share your knowledge.