Question

About PTR & MX Records in Digital Ocean

Posted December 5, 2020 442 views
EmailDNSConfiguration Management

I am going to deploy my next big project in DigitalOcean. Before going with DigitalOcean I just want to be clear on few things about PTR records.

I have read most of community answers related to PTR records. And, up to my knowledge (understanding as well), DigitalOcean configures PTR record based on *Droplets * name.

I have this scenario for my next project:

  1. I want to host my website in DigitalOcean Droplets (let’s say its IP is 77.77.77.77 with URL lets say (abc.co.uk)
  2. I want to set mail server in URL mail.abc.com.au and this is not in DigitalOcean and its IP is (let’s say) 88.88.88.88 in different server.

My Confusion is:

Should I name my droplets as “abc.com.au” or “mail.abc.com.au”?

And how do I configure A, MX, PTR records for perfect configuration so that there is no any issue related to spam and transaction of system generated mail (as far as I know, most of mail exchange services in these days do match dns and rdns for mail transaction (correct me if I am wrong))

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

Hello, @eramesh11

DigitalOcean will automatically create PTR records for your Droplets based on the names you give your Droplets in your DigitalOcean control panel.

The name of your Droplet must be a valid FQDN (Fully qualified domain name), so using example.com as the Droplet name will create a PTR record, but ubuntu-s-4vcpu-8gb-fra1-01 or my-droplet will not.

It is up to you if you will use abc.com.au or mail.abc.com.au as your hostname. Usually a subdomain can be handy so you can go with something like droplet.abc.com.au and etc. Keep in mind this is totally up to you.

You can set the MX record to any subdomain of your choice like mail.abc.com.au as long as this subdomain is pointed to your droplet’s IP address. You can also set the MX record to match the droplet’s hostname, this will work too.

As for improving your outgoing emails you can make sure you have a SPF (this is basically essential)record added and also you can use any website like:

https://www.mail-tester.com/

In order to test test the spammyness of your emails. The result will tell you what else you can do in order to improve the score of your emails.

Hope that this helps!
Regards,
Alex

  • One more thing:

    On configuring that way:

    nslookup mail.abc.com.au gives 88.88.88.88, right?

    and how does nslookup 88.88.88.88 gives mail.abc.com.au?

    since 88.88.88.88 is different server and what should I configure in mail server i.e. 88.88.88.88 to get that rdns?

    • Hi there! When checking PTR records, you can use the dig or host commands:

      dig -x IPADDRESS +short

      or

      host IPADDRESS

      If I have misunderstood your question, please clarify!

      DNS Tips and Tricks
      https://www.digitalocean.com/community/tutorials/dns-tips-and-tricks

      by Etel Sverdlov
      This tutorial covers several tips that help a user when setting up DNS. It covers confirming if your DNS records are working with the "whois" and "dig" commands, setting up load balancing, and changing your nameservers seamlessly.
    • You can use the server/droplet’s hostname as the mail server in your application as this will be pointing to the correct IP address.

      Also the IP address will have the correct PTR/RDNS so you should not have any issues with the mail delivery as well.

      Let me know if you’ve meant something else.

      Hope that this helps!
      Regards,
      Alex

      • Here is my actual scenario:

        I am lost in DNS and rDNS (PTR) record setting for the following scenario:

        I have my main website (example.com) running in Digital Ocean at IP 1.2.3.4

        In Digital Ocean control panel I have following records:

        • CNAME -> imap -> mail.example.com
        • CNAME -> smtp -> mail.example.com
        • MX -> example.com -> mail.example.com
        • A -> mail -> 5.6.7.8

        I have my mail server at 5.6.7.8 is hosted in different server (say Linode).

        Due to missing rDNS (PTR) record system generated mail are not delivered correctly.

        From Digital Ocean docs I have found that Digital Ocean configures PTR based on host name so I renamed my droplets to example.com and changed hostname as well, so that it will create PTR records for me.

        I don’t have any clue what to do next as I am new to dns stuffs.

        What am I missing here and how should I configure mail for this scenario so that there is no any problem regarding mail delivery and spamming issues?