rDNS for name other than hostname?

November 29, 2015 924 views

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?

1 comment
  • I have read your email about subdomain rDNS which donates place for deployment ,please my place or my city is DURBAN in south africa province Kwazulunatal , i will appreciates if subdomain deploy me in my city which is durban

2 Answers

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 subdomain.example.com is a valid A record pointing to the same Droplet.
by Pablo Carranza
A carefully tailored SPF record will reduce the likelihood of your domain name getting fraudulently spoofed and keep your messages from getting flagged as spam before they reach your recipients.


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.

Have another answer? Share your knowledge.