rDNS for name other than hostname?

I have my hostname prefixed by a subdomain which denotes it’s place in a deployment chain. So something like… dev/test/deploy… Though I would like my rDNS to point to domain without prefix. So email sent from deploy does not bounce. Is this possible? How to do?

Show comments

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.


Reverse DNS, or a PTR record, should be set to your hostname (this is automatically attempted when you setup your Droplet), not to your domain name and you should setup a proper hostname both through the DigitalOcean CP and on your server if you intend on sending and receiving e-mail, if you have not already.

To do this, you’d need to login to the DigitalOcean CP and make sure your Droplet has a proper hostname, such as:


If this is not the case currently, you can click on the name of the Droplet, click on Settings from the left side menu and finally, click on the tab “Rename.”

Enter in anyname.yourdomain.ext (of course, replace this with your preferred hostname) and click on the blue rename button.

Once set, you’ll need to login to the CLI and execute:

hostname anyname.yourdomain.ext

To setup the hostname at the server level (this can set or change the hostname, in either case, it sets the hostname to whatever you pass).

Once you’ve done this, then you’d need to make sure you’ve setup an SPF entry and an A entry for your hostname. The A entry would like something like:

A            anyname            PUBLIC_DROPLET_IP

You don’t need to enter the full hostname for the A entry, just the name (as shown in my example above). You’ll need to replace PUBLIC_DROPLET_IP with the IP of your Droplet.

The rDNS record for your Droplet’s IP is automatically set to your Droplet’s hostname. The only way to modify the rDNS record is to actually rename the Droplet to whatever you want the rDNS record to be.

I would recommend trying to stop the emails from bouncing/going directly to spam instead:

  1. Add an SFP record: How To use an SPF Record to Prevent Spoofing & Improve E-mail Reliability
  2. Make sure that the droplet’s OS hostname (see /etc/hostname – reboot for any changes to take effect) matches the rDNS record which is the Droplet’s hostname in the control panel
  3. Make sure that is a valid A record pointing to the same Droplet.