Long TXT records–over 255 characters

For the record, let me state that I am not a DNS expert and this may seem simple for someone that is. But since I could not find anything to help me resolve this problem, I figured I would blog about it to possibly save someone else the headache that I encountered.

The other day I was working on an SPF record for a client that was over 255 characters. This is the limitation for TXT records in DNS for each string. I spent quite a while working on this and tried every iteration I could think of to get it to work. I even found quite a few articles that talked about breaking the records into multiple strings but could not get that to work. So I settled for creating a new subdomain within the domain and adding part of the text to an SPF record in the subdomain. I then used the include:subdomain feature within the record. This worked perfectly as a way to get around the issue. The client, however, did not like this solution. So back to the drawing board.

I am a literal person. If it is a string, I make it a string by using quotes. This is also how the examples showed it. That, needless to say, is not what needs to be done. Long story short, if you need to break an SPF record into multiple strings, here is how it is done.

  1. Create the new TXT record in DNS Manager
  2. Add the first part of the record (up to but not exceeding 255 characters)
  3. Hit enter within the record to start a new line.
  4. Add a space and then the next portion of the record up to but not exceeding 254 characters.
  5. Repeat step 4 until all data is in the record.
  6. Save the record

You can then use a site like MXToolbox to verify the SPF record. If the record is correct, you will receive output that looks like this:

image

If any portion of the SPF record is incorrect, you will get an error and additional text which points to the problem with the record. If the record contains any string that is over 255 characters, you will receive an empty response.

At the end of the day, the client was happy and I learned something as well.

Terri is a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: