About PTR & MX Records in Digital Ocean

Posted December 5, 2020 544 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 with URL lets say (
  2. I want to set mail server in URL and this is not in DigitalOcean and its IP is (let’s say) in different server.

My Confusion is:

Should I name my droplets as “” or “”?

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 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 or as your hostname. Usually a subdomain can be handy so you can go with something like and etc. Keep in mind this is totally up to you.

You can set the MX record to any subdomain of your choice like 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:

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!

  • One more thing:

    On configuring that way:

    nslookup gives, right?

    and how does nslookup gives

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

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

      dig -x IPADDRESS +short


      host IPADDRESS

      If I have misunderstood your question, please clarify!

      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!

      • Here is my actual scenario:

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

        I have my main website ( running in Digital Ocean at IP

        In Digital Ocean control panel I have following records:

        • CNAME -> imap ->
        • CNAME -> smtp ->
        • MX -> ->
        • A -> mail ->

        I have my mail server at 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 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?