TXT Record Format and Long Record Handling

Last updated

A TXT (Text) record holds one or more strings of text, each up to 255 characters. DNSimple adds the quotes and splits long values into 255-character strings for you, so you can paste a value as a single line. This reference covers the format rules, the limits DNSimple applies, and how it handles quotes and long values.

TXT record format basics

A TXT record is made up of one or more strings of text. According to RFC 1035, each string within a TXT record can be up to 255 characters long.

DNSimple’s input handling for TXT records

You enter the value in the Content field. DNSimple handles most of the RFC formatting for you, and treats the value in one of two ways:

Scenario 1: Providing an unquoted value (deserialized input)

This is the most common and recommended way to provide your TXT record content in DNSimple. Enter the raw text string without adding any double quotes (“) around it.

  • DNSimple’s processing: When you provide an unquoted value, our system will automatically serialize the content to conform to DNS standards. This involves:
    • Wrapping the entire content in double quotes (“).
    • Automatically escaping any double quotes (“) that are present within your original text string with a backslash (").
    • Example: If you input I have "quoted text" here, DNSimple publishes it as "I have \"quoted text\" here".
  • Constraints: When providing unquoted input, the total length of your content (after DNSimple’s automatic serialization, including added quotes and escaped characters) is limited to 1000 characters.

Scenario 2: Providing a value wrapped in double quotes (serialized input)

The provided TXT record content is already enclosed in double quotes (e.g., copied directly from another source that presents it in RFC-compliant serialized form).

  • DNSimple’s processing: Our system will store and publish this content verbatim, without making any modifications. You are responsible for ensuring that the content adheres strictly to RFC 1035 rules for serialized TXT records, including:
    • The entire value must be wrapped in double quotes.
    • Any double quote characters (“) that are present within the content string must be escaped with the sequence ".
  • Constraints: The total length of the content you provide (including quotes and escaped characters) must not exceed 1000 characters.

If the value starts with v=spf1, DNSimple also checks it as an SPF record and rejects invalid SPF syntax. See SPF Record Syntax and Validation Reference.

Handling long TXT records

According to RFC 1035, if a TXT record’s content exceeds 255 characters, it must be split into multiple strings (or “chunks”), each not exceeding 255 characters. These chunks are then concatenated by DNS resolvers during lookup.

DNSimple splits long TXT records for you:

  • Simplified input: You are not required to manually split long TXT record content into 255-character chunks when entering it into DNSimple. You can provide the entire long string as a single value.
  • Automatic splitting: DNSimple will automatically handle the necessary splitting of your long content into compliant 255-character chunks before publishing it to our name servers. This ensures maximum interoperability across the internet’s DNS infrastructure.
  • Pre-split input (advanced): If you provide content that is already split into quoted strings separated by spaces (for example, "chunk1" "chunk2"), DNSimple keeps your split. If any of your strings is longer than 255 characters, DNSimple splits it further when publishing.

Example: long 2048-bit DKIM public key

Consider a typical 2048-bit DKIM public key, which is often longer than 255 characters.

Input provided to DNSimple (as a single, unquoted string):

v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxUDvrr1HvQ079r5vXSxesSjWuLETvRFT4fduNGuT+X/EoWsy/BcFGGlhLu3T21DJiniY0bAGlPHo7Z6Gv/z22fceR45Q9/9oQed9kQDaZhlcnCzYK/2VM3KY0Rkoet/76t1DYlvq60BzZEAC5u1iau3cezho5j1qU6tL1WgVtYDiC2IFrdLGwVm34k3E/bBy9HxiayI1LpWbDKNjnksEKsU85XOWYMj5EWqDR0wbiLGjdqyGbu7zD7NkiE8qWToLL83P1h8qatK8EIfmxbleFS1m5QSvWXIsDNDTA4u6fDG6/JkggbmY/toj8CPQ7Ze6SCoOFvoL4W+9wnBspC51qwIDAQAB

How DNSimple serializes it (one quoted string):

"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxUDvrr1HvQ079r5vXSxesSjWuLETvRFT4fduNGuT+X/EoWsy/BcFGGlhLu3T21DJiniY0bAGlPHo7Z6Gv/z22fceR45Q9/9oQed9kQDaZhlcnCzYK/2VM3KY0Rkoet/76t1DYlvq60BzZEAC5u1iau3cezho5j1qU6tL1WgVtYDiC2IFrdLGwVm34k3E/bBy9HxiayI1LpWbDKNjnksEKsU85XOWYMj5EWqDR0wbiLGjdqyGbu7zD7NkiE8qWToLL83P1h8qatK8EIfmxbleFS1m5QSvWXIsDNDTA4u6fDG6/JkggbmY/toj8CPQ7Ze6SCoOFvoL4W+9wnBspC51qwIDAQAB"

How DNS resolvers see it (split into 255-character strings by DNSimple):

example.com. 3600 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxUDvrr1HvQ079r5vXSxesSjWuLETvRFT4fduNGuT+X/EoWsy/BcFGGlhLu3T21DJiniY0bAGlPHo7Z6Gv/z22fceR45Q9/9oQed9kQDaZhlcnCzYK/2VM3KY0Rkoet/76t1DYlvq60BzZEAC5u1iau3cezho5j1qU6tL1WgVtYDiC2IFrdLGwVm34k3E/bBy9" "HxiayI1LpWbDKNjnksEKsU85XOWYMj5EWqDR0wbiLGjdqyGbu7zD7NkiE8qWToLL83P1h8qatK8EIfmxbleFS1m5QSvWXIsDNDTA4u6fDG6/JkggbmY/toj8CPQ7Ze6SCoOFvoL4W+9wnBspC51qwIDAQAB"

The value is published as two strings: the first 255 characters, then the remaining 155. Resolvers and mail servers join the strings back together, so the key is read as one value.

Quotes and special characters in TXT values

Double quotes: If your provider gives you a TXT record value that is already enclosed in double quotes (e.g., "v=DKIM1;..."), you can provide it directly as serialized input. DNSimple will store it verbatim.

Backslashes before semicolons: Some tools and providers show backslashes before semicolons (for example, v=DKIM1\;). These come from zone file display formats. Remove them before you enter the value in DNSimple, whether or not you wrap it in quotes. Semicolons do not need escaping in a TXT value.

Other characters: Do not modify forward slashes or any other unusual characters that are part of the legitimate value string (e.g., within a Base64 encoded key, or an email/URL). Only handle quotes and backslashes as described above.

References

RFC 1035, Section 3.3.14: Domain Names - Implementation and Specification (TXT record specification).

Have more questions?

If you have additional questions or need any assistance with your TXT records, just contact support, and we will be happy to help. You can also read more about DNS hosting at DNSimple.