Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TXT records of length more than 255 characters. #1428

Closed
matheswaran99 opened this issue Mar 6, 2023 · 2 comments
Closed

TXT records of length more than 255 characters. #1428

matheswaran99 opened this issue Mar 6, 2023 · 2 comments

Comments

@matheswaran99
Copy link

matheswaran99 commented Mar 6, 2023

In some cases the TXT record might have more than 255 characters. But dns does not support with more than 255 characters. And also getting error like "dns: string exceeded 255 bytes in txt".

@gibson042
Copy link
Collaborator

The content of a TXT record is a sequence of <character-string>s, each of which is itself limited to maximum content length of 255 characters (and it isn't even possible to attempt expressing a longer one on the wire).

RFC 1035 section 3.3.14

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    /                   TXT-DATA                    /
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

where:

TXT-DATA        One or more <character-string>s.

TXT RRs are used to hold descriptive text. The semantics of the text depends on the domain where it is found.

RFC 1035 section 3.3

<character-string> is a single length octet followed by that number of characters. <character-string> is treated as binary information, and can be up to 256 characters in length (including the length octet).

Some higher-level protocols such as SPF interpret a TXT record containing multiple <character-string>s by concatenating those strings and treating them as a single longer string (cf. RFC 7208 section 3.3), but that is not inherent to the DNS, which must therefore preserve each individual element of the sequence.

@tmthrgd
Copy link
Collaborator

tmthrgd commented Mar 7, 2023

As mentioned above, this is unfortunately a limitation in DNS itself and how to address it is protocol specific. Closing.

@tmthrgd tmthrgd closed this as completed Mar 7, 2023
@tmthrgd tmthrgd closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants