PTR record for multiple domains on the same droplet

May 9, 2015 6.2k views
Email DNS DigitalOcean Ubuntu

I have 2 domains hosted on the same droplet (and the same IP)
How do I set PTR records for both, so the mails going from both domains will not be rejected?

4 Answers

Thank you for your answer, but it would be easier to me to understand it with a sample.
Currently this is what I have:
the droplet name is something.com (not domain1.com or domain2.com)
it host 2 domains:
with MX: domain1.com.
with MX: domain2.com.

Do you suggest to change domain2 MX to domain1.com.?
In this case emails from user@domain2.com will not be treated as spam?

Your droplet has a dedicated IP. For people to remember this droplet's address easier, you are asked to enter a 'hostname'.

What is hostname? This is the part where most people get confused. They assume by hosting a website 'abc.com' in this droplet, you should enter 'abc.com' as hostname. Well, there is nothing wrong about it, but it become an issue when you are hosting more than one website in single droplet (who don't?)

By practise:

Droplet #1: fire.serverdroplet.com
Hosting website 'abc.com' and 'xyz.com'

Droplet #2: water.serverdroplet.com
Hosting website 'def.com' and 'mno.com'

Your PTR are assigned to both fire.serverdroplet.com and water.serverdroplet.com

  • So if the droplet is fire.serverdroplet.com for IP1 the PTR for IP1 will be fire.serverdroplet.com, handled automatically by DO (i.e. I don't need to edit anything in the DNS settings of the droplet), right?
    And abc.com xyz.com MX should be what? fire.serverdroplet.com?

  • Yes, PTR will be handled by DO. It is a label of IP-to-hostname. Not something of your DNS settings, etc

    I assume you wish to enable email service for abc.com and xyz.com. First, assuming you have the email services installed in droplet 'fire.serverdroplet.com'. You have to create MX records for both abc.com and xyz.com:

    MX record: abc.com, priority is 10

    MX record: xyz.com, priority is 10

    Notes: email service is not something you can do with one droplet. It is a rather complicated services which require many other services to work - Spam, virus, backup, archiving, IMAP, webmail, email control panel. You can host email with third party email hosting company and point the MX there. Or, you can also try Sendgrid.com if you just need a SMTP server to deliver some email for your project.

  • abc.com and xyz.com should both be pointing to the IP address of fire.serverdroplet.com

This isn't how you do it, for one a ptr can only be a single domain
Secondly, you should point your second domains mx record to the same A record as domain1's mx. That way they will both work with the one ptr.

Have another answer? Share your knowledge.