The SPF record a domain owns can have the maximum length of 255 characters.
A longer record - or even nearly that long - is not advisable as recipient servers have a more difficult job to process all elements, especially if the record contains a lot of domain names and "include" clauses as that will trigger other DNS lookups during the process, making SPF checks even slower.
However, if we have a domain where we have to add many entries to the SPF record and it would grow larger than 255 characters we have a way to come around that limitation. The trick is that we split the record into multiple entries and add those entries to the actual SPF record as "include" entries.
Example
Always Hot Café has a very long SPF record, so long that recipient email servers have trouble processing it.
Original, too long version:
Now, to sort the issue, we split the record into two separate TXT records, and include them in the main SPF record, as follows:
First piece:
Second piece:
Main:
Once the DNS propagation is done (the lower TTL is used the better to speed up the process), the recipients will have no problem interpreting the SPF pieces as one.
Ivan Sokac says
Thank you so much for sharing this! Just a small mistake in the result (main).
The second include should be
include:spf-part2.alwayshotcafe.com
if I’m not mistaken.
Great article btw!
Zsolt Agoston says
Hi Ivan, you’re absolutely right, mistake is corrected, thank you for pointing it out