Question

How do I setup a PTR Record?

I am running an email server and my outgoing emails are finding themselves in the recipient’s spam box.

After diving into the issue… I am seeing that the issue is coming from being unable to do a reverse DNS lookup.

I’ve added all the appropriate mail records (A, MX, TXT) and am still coming across this issue.

This is what I am seeing from www.intodns.com/americanglassandmirror.com

Reverse MX A records (PTR) ERROR: No reverse DNS (PTR) entries. The problem MX records are: 30.253.236.104.in-addr.arpa -> no reverse (PTR) detected You should contact your ISP and ask him to add a PTR record for your ips

Can you clue me in on what I could be missing here?

Subscribe
Share

DigitalOcean automatically configures the reverse dns entry (PTR) on their end. It will be the hostname you choose when you set up your dropplet. You can change/check this in the control panel by selecting your dropplet, then settings, then rename. As it says, changing the name there will update the PTR but not the hostname of the system, that is something you will need to do, instructions for that vary depending on the system you have installed.

You can check the PTR by using the host command as follows: host <IP_ADDRESS> You will have to substitute your IP address in the command above. Example: host 8.8.8.8 8.8.8.8.in-addr.arpa domain name pointer google-public-dns-a.google.com.

You may also be a little confused: You can not update the PTR of an IP address you have not been assigned (in the U.S. by ARIN). The IP address you are using from DigitalOcean may be able for you to use, but it has not really been assigned in a way you can freely control as far as reverse dns goes, therefor you can’t change a PTR record for an IP you don’t have access to. (That’s why mail servers check PTR; if you have a properly configured reverse dns record your more likely to be authorized to send mail from that IP.)

Good luck.

I can’t find the “settings” option on my droplet. I did find the domains option from the list of droplets -> dropdown on the right “more” -> “add a domain”? I did that but a PTR Record is still not being indicated. Do I just need to wait for the record to propagate?

This comment has been deleted

This comment has been deleted

An additional note… that is not my IP address on DigitalOcean.

After doing a lookup on that IP address… it said that it was the “DoD Network Information Center”. Does anyone have any insight on to why its pointing to their IP?

This only seems to be the case when I do a PTR lookup (dig -x ipaddr) on my digital ocean address.


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

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.

A support staff helped me with the problem:

The droplet must be named with a fully qualified domain name (example something.com) before a PTR Record can be created. To rename the droplet select it from the droplets control panel and in its own page click on the name itself (there is no obvious button).

But then how does that work when you have more than one domain on the droplet? Which PTR record/domain gets the short straw?

Too old answer (2013) in another question:one PTR for every droplet. I do not found a recent answer.

HI,

I fallow this link its working Example link

Step1: Change the Droplet name as your Domain name, The Digital Ocean Automagically tack the rDNS .

To check rDNS :

  1. Click on the Networking --> then click on PTR record.
  2. Check thorough command line , Type command $ host 'your ip addres'
  3. Check thorough this url Example link

Hi,

I have the same problem on my droplet. How is this configured if you multiple domains on the droplet though?

If I configured the reverse DNS lookup with an FQDN for domain A, and sent an email from domain B, wouldn’t the emails from domain B show as coming from Domain A ?

If yes, is there ayway around this? Thanks

I too have two domains on one droplet and would like to know how to give them both PTR records. Why not assign PTR records based on A and AAAA records?

Edit: Thinking on it some more, it seems possible that you can’t have an ip address resolve to more than one domain, as a limitation of the reverse DNS system. In which case: wow gg protocol writers. Way-to-go. Thanks a bunch.

Though it would be more the fault of email servers for using a broken filter method in the first place.

It doesn’t seem like there is, but is there a workaround?

Hi @nikolayurchin<

Changing PTR

DigitalOcean automatically configures the reverse dns entry (PTR) on their end. It will be the hostname you choose when you set up your droplet. You can change/check this in the control panel by selecting your droplet, then settings, then rename. As it says, changing the name there will update the PTR but not the hostname of the system, that is something you will need to do, instructions for that vary depending on the system you have installed.

To set one, you need to enter your Droplet via SSH and:

Change the hostname using hostnamectl

The first step once you have entered the droplet would be to use the hostnamectl command. Let’s say we want to name our droplet ‘ExampleName’. To do so, we need to execute the command like so

sudo hostnamectl set-hostname ExampleName

The hostnamectl command does not produce output. On success, 0 is returned, a non-zero failure code otherwise.

Update the /etc/hosts file

Next on our list would be to update the hosts file located in the etc folder. You can use any editor you want from nano, vi, vim.

sudo vim /etc/hosts

In there you’ll see something similar to

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.1.1 PreviousNameHere
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Change the line which says the following

127.0.1.1 PreviousNameHere

to be

127.0.1.1 ExampleName

Save the file and exit.

Hope that this helps!

Please help me to setup PTR Record for bestviagramedicine.com

Hello,

The Reverse DNS is configured automatically from our end based on the droplet’s hostname.

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.

For managing DNS records from DigitalOcean Kubernetes Using ExternalDNS you can check this tutorial:

https://www.digitalocean.com/community/tutorials/how-to-automatically-manage-dns-records-from-digitalocean-kubernetes-using-externaldns

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.

Hope this helps. Regards, Alex

I also have the same problem on my droplet with multiple domains, only one has this problem though as the client is using an aol email, my mail logs state “421 mtaig-aab02.mx.aol.com Service unavailable - try again later.”

Good question ianjhar, if anyone knows the answer would appreciate some advice before I start tinkering with the FQDN:

"If I configured the reverse DNS lookup with an FQDN for domain A, and sent an email from domain B, wouldn’t the emails from domain B show as coming from Domain A ?

thanks