Multiple PTR (reverse DNS) Records (Postfix)

November 3, 2013 20.6k views
Postfix is setup on my droplet where multiple domains (sites) are hosted. When sending some transactional emails from sites, they bounce to certain recipients though. From the mail.log (redacted), "... (host[] refused to talk to me: 521 Service not available - no PTR record for" Now, my understanding is that you should only create single PTR records so am a little unsure of how to proceed? I am aware of one option is to use an external service like Mandrill or SendGrid but would like to know what my options are for keeping my emails being sent from my droplet. Thanks!
1 comment
15 Answers
I have multiple websites running on each droplet though.

If I understand what you are suggesting, while this would solve the issue for one domain the others would still suffer.

Thanks for spending so much time on this though BTW.
You can set the droplet's hostname (which would update the PTR record along with it) to e.g. where is one of the domains on that droplet, and then add an A record for that points to your droplet.

This way it's a valid PTR <=> FQDN setup and it will work fine for all of the domains on that droplet.
Are there PTR records listed in your DigitalOcean Control Panel?
Only the ones setup by digital ocean which point to the hostname of the VPS.

e.g. -> server a -> server b
and it's the domains that do not form the FQDNs of your droplets that are bouncing?
I don't have any domain names in the PTR record in the DO DNS section. I named my droplets with unique names when creating them.

So yes thats correct but by default really - as none of the domains form the hostnames of my droplets :-).

Log into your DigitalOcean Control Panel and click on Droplets => Settings => Rename for each droplet and rename it -- incorporating your domain name so that you end up w/a FQDN, e.g. hostname.yourdomain.tld
Excellent, thanks very much for your help Kamal and Pablo!
Thanks by the advice.
Just only one question, what about the /etc/hostname file? set it with the same name of the droplets or it isn't necessary?
It should already be set to your droplet's hostname however you can modify it anytime you want and then run
sudo hostname -F /etc/hostname
for the changes to apply.
so does my hostname need to be mail or does my droplet need to be named mail or i started following the link that pablo posted, but it is also not clear there if the hostname is mail or the full

i also need to server mutliple domain names with a single droplet. i made my droplet named "" (with one of the domains on the droplet instead of

then added an A record to that domain's dns record with value mail and my ip address.

how can i test if my reverse dns is working?
@billy: sounds good. You can test if reverse dns is working here:
So I set this up and it appears to be working -- but what about MX records... do I need to set those up as well? I'm going to have multiple domains on one droplet.
@Kamal I understand what you are saying here:

"You can set the droplet's hostname (which would update the PTR record along with it) to e.g. where is one of the domains on that droplet, and then add an A record for that points to your droplet."

However I am confused how this works for multiple domains on the same droplet. For example I have and on the same droplet and I want to setup email on both domains. Do I therefore name my droplet and setup an A record for and pointing to the same place and then everything works with reverse DNS? Or have I completely misunderstood you?
  • I want answer to this as well. It doesn't seem like this can be done unless we get multiple ip per server. Right now DO doesn't support that and maybe they don't really want to to sell more droplets, but I rather they sell ip address.

  • I works for all domains on that droplet. comment ref

Have another answer? Share your knowledge.