How to setup a PTR record?


I have a contact form on my website (hosted with Digital Ocean). The contact form sends form submissions to my Google G-Suite email address. Unfortunately emails are being marked as spam.

My setup

  1. I’m managing my DNS with
  2. I’ve added SPF and a DKIM txt records but emails from the form still end up in my spam folder.
  3. I’m using to manage my Digital Ocean server

Where I’m up to

  1. After a bit of digging around the Digital Ocean forum I found out about the PTR record
  2. I also discovered, this highlighted another issue that is most likely causing problems with spam
  3., shows I’m also missing a dmarc record.
  4. I’ll create a separate post about setting up a dmarc record.

Have I correctly setup my PTR record? This is what I’ve done:

  1. My Droplet was called my-company-website
  2. I found this ServerPilot guide How to Set PTR Records and Reverse DNS
  3. According to the guide:

DigitalOcean will set a PTR record for your server as long as you use a fully qualified domain name (FQDN) like rather than a single-label hostname like pluto.

  1. For this example my domain is
  2. I used to name my Droplet
  3. I logged into Terminal and ran host
  4. It shows the domain name pointer is now the same as my droplet name
  5. domain name pointer
  6. The changes appear to be almost instant on the Digital Ocean droplet
  7. Testing this in still shows errors, but from reading other posts I need to wait at least 24 hours for these changes to propagate.
  8. Have I done this right?
  9. Are there any other steps I should take related to PTR record setup?

Kind regards Stephen Meehan


I’ve not waited 24 hours for the changes to take affect, but it looks like they have partly worked…

I’ve ran a test submission from my contact form on my website, emails are still going to spam. But I thought I’d take a look at the email header to see if I can spot any mention to the updated domain name pointer

It looks like Google Mail can see the update, is in the header…

This bit looks like it could be wrong:

Received: from ( [])

It still says Received: from my-company-website. That was the original name of my Droplet

Is that supposed to still say that?

Here’s the full header, I’ve redacted any IP addresses.

Received: by with SMTP id f64csp2990959ivf;
        Thu, 2 Feb 2017 03:50:54 -0800 (PST)
X-Received: by with SMTP id t188mr7968770wmt.15.1486036253973;
        Thu, 02 Feb 2017 03:50:53 -0800 (PST)
Return-Path: <>
Received: from ( [])
        by with ESMTP id xxxxxxxxxxxxxxxxxxxxxxxx
        for <>;
        Thu, 02 Feb 2017 03:50:53 -0800 (PST)
Received-SPF: softfail ( domain of transitioning does not designate as permitted sender);
       spf=softfail ( domain of transitioning does not designate as permitted sender)
Received: by my-company-website.localdomain (Postfix, from userid 1000) id 0CD8E40899; Thu,
  2 Feb 2017 11:50:53 +0000 (UTC)
Subject: Paul - Enquiry
Date: Thu, 2 Feb 2017 11:50:52 +0000
From: Company Name <>
Message-ID: <>
X-Mailer: PHPMailer 5.2.21 (
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8

Name:                         Paul Test
This is a test

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello, all

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.

To rename your droplet via the control panel, do the following:

Login to the Digital Ocean Control Panel

Go to Droplets --> Click the droplet you want to rename
Then, on the droplet detail window, click on the name of your droplet (you wouldn’t know you could)
Go to the Settings Tab --> Change the name in the entry field and click the check mark

Make sure you also edit your droplet’s hostname internally as well. Update /etc/hostname and /etc/hosts and reboot.

The PTR should be automatically adjusted in few hours due to DNS cache. If this is still not working after several hours, you can contact our support team as well.

Hope that this helps! Regards, Alex

This sort of issues are easier to tackle using the right set of tools in my humble opinion.

Google offers Postmaster tools to check email issues/quality on their end.

And I’ve been using to verify both SPF and DMARC records. This service will show all the passes and fails for every mail from every sender origin.

To mitigate this kind of issues we stopped sending mails from our webservers all together and started using Postmark Mails never went to spam and the most convenient thing is to have clear feedback on every send email so we know if it bounced / got rejected / read / unread.

I hope this is of any help to future readers :)


Thanks for the replies.

  • I couldn’t get etc/hosts to keep the edits I made after a sever reboot
  • So I effectively couldn’t rename the host
  • It was quicker to just create a new Dropletwith a FQDN from the start
  • To be honest I think the PTR record was the only part of the puzzle
  • After setting up the Droplet with a FQDN, I noticed emails did appear in my inbox
  • Looking at the Email Header I could see they had an spf softfail
  • After some more digging around I was able to edit my spf record
  • Emails from my website contact form now go to my inbox (great) and are marked with a spf pass (brilliant).
  • Phew :)