Why do I need revDNS (PTR) record
If you have, for example Ubuntu 20.04 droplet on DigitalOcean, used to host a WordPress using localhost MTA to send mail notifications, you need to set up a Reverse DNS record to make sure your emails are delivered.
Usually the outgoing emails from the hosted sites are being rejected or marked as spam by many mail servers.
Additionally, if the A
DNS record for the droplet (VM) is not hosted on
Digital Ocean, but on a third party DNS hosting service, you don’t have to move
it to DigitalOcean.
How to setup a Reverse DNS (PTR) record for my droplet
The Reverse DNS is configured automatically from our end based on the droplet’s hostname.
To rename your droplet via the control panel
- 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 (on top) of your droplet (you wouldn’t know you could)
- Change the name in the entry field and click the check mark
To confirm the settings are correct
- From the left menu select
Networking
- Select
PTR records
tab
Finally, make sure you also edit your droplet’s hostname internally
- Update
/etc/hostname
file- on Ubuntu use
sudo hostnamectl set-hostname subdomain.domain.com
- on Ubuntu use
- Update
/etc/hosts
file127.0.0.1 localhost subdomain 127.0.1.1 subdomain.domain.com
- Reboot your droplet (VM) with
sudo reboot
Verification
The PTR should be automatically adjusted in few hours due to DNS cache.
Check if it works using host my-public-ip
Comments: