Question

How should MX records look like for personal mail server

Posted January 18, 2021 691 views
Email

Hey,

I have a droplet on digital ocean hosting my own web server and now I’m trying to add a mail service with some combination of dovecot and postfix. I’m running into two issues:

1) I am confused how to setup my MX DNS records. I tried to follow this guide, but I didn’t quite understand: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-postfix-e-mail-server-with-dovecot
At the moment, I have the following.
URL:: example.com
MX: 2 records:
mail.example.com mail handled by example.com
example.com mail handled by mail.example.com
Pretty sure this is wrong, but what should it be? Just the second one?

2) Online test services report Reverse DNS is not a valid Hostname
As far as I can tell, I have done everything right in order to have Reverse DNS lookup. My hostname and /etc/hosts are set to example.com and my droplet is named example.com
The output of the host command:


% host example.com                                    
example.com has address IPV4ADDR
example.com has IPv6 address IPV6ADDR
example.com mail is handled by 50 mail.example.com.

% host IPV4ADDR
reverse_ip_address_here_.in-addr.arpa domain name pointer example.com.

Cheers,

Nick

edited by bobbyiliev
1 comment
  • Further to my questions, emails to my address bounce with:

    DNS Error: 11093240 DNS type 'mx' lookup of example.com responded with code 
    NOERROR 11093240 DNS type 'aaaa' lookup of mail.example.com. responded with 
    code NOERROR 11093240 DNS type 'aaaa' lookup of mail.example.com. had no 
    relevant answers. 11093240 DNS type 'a' lookup of mail.example.com. 
    responded with code NOERROR 11093240 DNS type 'a' lookup of 
    mail.example.com. had no relevant answers.
    

    I suppose that means my DNS lookup is not correct?

    edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there,

What I could suggest is the following:

  • First set up an A record for mail.yourdomain.com to point to your Mail Dropelt’s IP address
  • Then set up an MX for your domain name itself to point to mail.yourdomain.com

After that give it a couple of hours for the DNS cache to clear over the Globe and it should be ok.

As a side note, from the host command output that you’ve shared, I was able to check your domain name and the setup looks correct at the moment I believe.

Regards,
Bobby