Why do your SPF includes have more than 255 character?


A single String in a TXT or SPF record cannot exceed 255 bytes, but a single record is allowed to contain multiple Strings. For records longer than 255 bytes, divide the record data into 255 byte Strings with quotation mark (") and separate each Strings by space.


Can TXT or SPF record longer than 255 bytes?


  • Yes, a TXT or SPF record longer than 255 bytes can be set, provided that each String is no more than 255 bytes. (As per RFC 4408, a TXT record is allowed to contain multiple strings, which should be concatenated together by the reading application)

 

  • A record can be separated into multiple Strings by separating each Strings with a space in the one single line itself adding from left to right in the dialog box.

 

Example Screenshot:

User-added image



RFC - https://www.ietf.org/rfc/rfc7208.txt


3.3.  Multiple Strings in a Single DNS Record

   As defined in [RFC1035], Sections 3.3 and 3.3.14, a single text DNS
   record can be composed of more than one string.  If a published
   record contains multiple character-strings, then the record MUST be
   treated as if those strings are concatenated together without adding
   spaces.  For example:

      IN TXT "v=spf1 .... first" "second string..."

   is equivalent to:

      IN TXT "v=spf1 .... firstsecond string..."

   TXT records containing multiple strings are useful in constructing
   records that would exceed the 255-octet maximum length of a
   character-string within a single TXT record.



Generated SPF records will also be less than 450 bytes. 



Reference - https://community.akamai.com/customers/s/article/How-to-set-TXT-or-SPF-record-longer-than-255-bytes-in-Authoritative-DNS?language=en_US