Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge 3 SPF records into the same

Tags:

record

dns

spf

I am having issues with my SPF records and I am not very familiarized with that. I need to add 2 additionnals SPF records to my current SPF records. At first, I just created 2 others TXT records but it seems it's not correct. I can only have 1 SPF records.

So, i need your help, i need to merge together those 3 SPF records :

v=spf1 +a +mx +ip4:184.170.132.66 +ip4:184.107.73.236 ~all
MS=ms46042964 
v=spf1 a mx include:freshbooks.com -all

The first one is from my hosting provider, the second one is for my Office 365 (my emails are managed with office exchange online) and the third one is for preventing that the invoices sent by freshbooks don't go in the junk of my clients.

Any help is appreciated, thank you very much!

Jean-Philippe

like image 310
JeePee Avatar asked Feb 13 '14 22:02

JeePee


People also ask

Can you combine SPF records?

SPF records can be combined by combining the rules in both SPF records. A rule is one of the parts of your SPF record, it consists of an optional prefix, the mechanism, and an optional value. If the prefix is not set, it defaults to + (pass). The mechanism and optional value are separated using a colon.

How do I fix multiple SPF records?

If you have multiple SPF records, the simple fix is to merge these entries into a single record. According to Alexa, one in 6 domains with an SPF record is using the wrong format, with multiple TXT records. So it's definitely worth checking to make sure you don't have any extra or unwanted SPF records.

Is that possible to add multiple IPS in SPF?

You can add as many IP addresses as needed to your SPF record up to the 255 character TXT record limit. If the number of IP addresses in your SPF record exceeds 255 characters, investigate different options to shorten your SPF record.

What happens if you have too many SPF records?

Generally, the reckless use of the “include” or the “redirect” modifier in an SPF record can result in the DNS lookups going over the 10-limit, thereby causing email deliverability issues. Exceeding the limit can return the error “permerror SPF permanent error too many DNS lookups.”


2 Answers

First, you probably want to look at a resource like this one: SPF Introduction. Once you've got an understanding of what SPF does and what a valid record looks like, try deleting the other 2 existing records and updating 1, for example:

v=spf1 +a +mx +ip4:184.170.132.66 +ip4:184.107.73.236 MS=ms46042964 include:freshbooks.com ~all

Then use an SPF validation tool to check the record. You're likely going to run into a "Too many DNS lookups" error though, which means you'll need to pare down the record to include only the information you absolutely need. See this post for more insight. And this is a good tool to see exactly where the record is exploding.

like image 95
terrorbox Avatar answered Oct 04 '22 00:10

terrorbox


A few years late...

But MS=ms46042964 is not part of an SPF, this is a Office 365 validation token, and should not be included in an SPF record, this will cause an error, both for MS doing the validation and performing a SPF test.

Also since you are switching to Office 365, you can remove the SPF from your hosting provider as you will not be using their email hosting. So the only SPF you would need is Office 365's.

like image 27
Matchstick Avatar answered Oct 03 '22 23:10

Matchstick