Question

SPF record is not matching rDNS for multiple domains on a single droplet

Posted January 22, 2020 223 views
EmailDNSUbuntu 18.04

I have a droplet with LAMP stack installed. Using Plesk, I have managed to host 10 domains successfully.

Let’s say my host name is set as “myHost.local” so DigitalOcean provides me a rDNS record for that (which I don’t have access). Then I have 10 domains hosted as domain1.com, domain2.com, …, domain 10.com all with their own DNS, SSL, email and everything set properly and functioning smoothly.

Now, the problem is that when I want to set an SPF record for my emails, it will technically look like this:

“v=spf1 +a +mx +a:myHost.local include:some3rdparty.eu -all”

  • Since there is no A record for that host name in every domain’s DNS records, all the emails that I send end up in recipient’s spam folder or get rejected.

  • If I change the a: identifier to my domain name, then there will be a rDNS mismatch and spamming again. I even tried to set in in include: identifier and got the same result.

  • If I change the host name to match my domain name, then I can fix it for only one of the domains and the problem remains for the rest.

Can anyone help me to set this up please? I feel very frustrated. :(
Thanks in advance!

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.

×
3 answers

Hello, @lniab

Have you tried to set the SPF record using the IPv4 address of your droplet instead of using the droplet’s hostname? I believe this should work just fine. You can try this using the following syntax:

"v=spf1 +a +mx +ip4:1.1.1.1 -all"

Let me know how it goes.

Regards,
Alex

  • Hi Alex,

    Thanks for the answer!
    I have tried that as you suggested as well as together with a:domain.com but then the problem is mismatch of rDNS record and SMTP record.

    The rDNS is defined by DigitalOcean as myHost.local but the MX record for each domain is mail.domainname.com in its DNS records.

    It raises the red flag about authorization of email sender which makes it go to spam.

    • Hello, @lniab

      Could you please let me know what do you mean by SMTP record?

      We automatically create PTR records for Droplets based on the name you give that Droplet in the control panel. The name must be a valid FQDN, so using example.com as the Droplet name will create a PTR record, but ubuntu-s-4vcpu-8gb-fra1-01 or my-droplet will not.

      The name of the droplet needs to be set to an actual domain/hostname and the forwarding DNS (A record) needs to point to the droplet as well, so the rDNS and the forward zone can match. Once this is done you should be all good.

      Regards,
      Alex

Hello, @lniab

Looking at the screenshot it’s says that the reverse DNS is not a valid hostname. Could you please check on this one and make sure that the droplet has a real domain/subdomain set for a hostname. - mail.yourdomain.se is pointed to your droplet.

Regards,
Alex

Yes! Both positive and that is why I don’t know what would be the issue now.

  • Hello, @lniab

    You can also contact our support team so they can check if the rDNS is configured properly as well. They should be able to sort any issues or at least point you in the right direction.

    Let me know how it goes.

    Regards,
    Alex

Submit an Answer