I am little confused about MX records. At least I think that is the problem, I followed a lot of guides about how to setup postfix, postfixadmin, dovecot on my VPS with Ubuntu 16.04, but I had no luck so far. It seems like everything is OK, but I can't send or receive any emails.

Also I can't connect with Thunderbird or any other email client to my server, probably because they can't find it. Below are some screenshots of my noip MX record, dig command results and /etc/host file on my VPS.

noip MX records
noip MX records

dig results
dig results

hosts file
/etc/hosts file

  • 2
    Two of your pictures were only of text. Please edit your question and add the text to your question. It's far easier to read, and we can cut/paste in replies to you. – guiverc Feb 11 at 11:18
  • Try specifying the record type explicitly : dig net4u.ddns.net MX. That however will use the specified system nameserver, to which your records may not have propagated yet. Can't suggest much else beyond that – Sergiy Kolodyazhnyy Feb 12 at 1:00
  • Thanks you are right the Dig MX shows: net4u.ddns.net. 0 IN A net4u.ddns.net. 0 IN MX 5 mail.net4u.ddns.net. – Tolis Feb 12 at 8:38

It's been a very long time since I have setup email servers. That was back in the day when we did not have the luxury of apt and such. Now getting down to your issue.

First thing is we need to know what you are trying to do. Are you setting up a email server so that you can send / recv email or are you just trying to get one of your php scripts to send an email to you.

1) The first thing is I don't think anything should be in your hosts file. Back up your hosts file and return it to the default. Actually your are better off just commenting out everything that was added. I have a running postfix on my box right now and I don't have any of those lines in my hosts file.

2) Check your local ports. nmap should show smtp.

3) There should not be any reason for all 3 aliases. Also the screenshot you have I am not sure what it is asking for. It says "hostname" not "FQDN". So is it supposed to be just the hostname ??

4) Your dig shows "IN A". That is an address record NOT a MX record. Your commands should be either dig mx net4u.ddns.net or dig any net4u.ddns.net

5) Read the "MX Records" section VERY carefully. It states "EXTERNAL" mail exchanger. DDNS does not usually allow people to run internal mail servers. YOU would have to check with noip to find out what they allow and don't allow. I just spent an hour trying to add a mx to my afraid.org DDNS account and could not do it. So you may not be able to do what you want.

  • First of all thank you for you answer. I am trying to send and receive email just for learning purposes. You are right about the hosts file it has so many unnecessary records, i was't sure what's the correct so i added all of them. the nmap show's: 25/tcp open smtp Dig any: net4u.ddns.net. IN ANY net4u.ddns.net. 0 IN A net4u.ddns.net. 0 IN MX 5 mail.net4u.ddns.net. I will check with NOIP about if they allow that and check more thoroughly the MX section, thank you again. – Tolis Feb 12 at 8:35
  • Yeah, that looks a whole lot better. However, from what I can see from your dig output. You need to have a A record for mail.net4u.ddns.net. It should read something like this: net4u.ddns.net 0 IN A >>> mail.net4u.ddns.net 0 IN A >>> net4u.ddns.net 0 IN MX 10 mail.net4u.ddns.net – dewd Feb 12 at 13:42
  • The '>>>' are there only to indicate line breaks. – dewd Feb 12 at 13:46
  • IF you are trying to setup a test email server then I would do it ONLY as a internal test box. So I would get rid of the noip.com stuff and use your email program (Thunderbird) with incoming set to and outgoing as Setting up a email server is dangerous work and if done wrong can get you in a lot of trouble. – dewd Feb 12 at 13:55
  • They can get you into so much trouble I would advise as NOT doing it. However at the same time I can appreciate the approach of setting one up as a learning / educational tool. Meaning you will never learn how to do it until you do it. A incorrectly configured email server can be used to send mail without your knowledge. All of this is probably getting beyond the scope of this post. – dewd Feb 12 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.