dns-zonefile icon indicating copy to clipboard operation
dns-zonefile copied to clipboard

TXT data should be treated as binary

Open aeden opened this issue 1 year ago • 0 comments

According to RFC 1035:

<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).

and

<character-string> is expressed in one or two ways: as a contiguous set
of characters without interior spaces, or as a string beginning with a "
and ending with a ".  Inside a " delimited string any character can
occur, except for a " itself, which must be quoted using \ (back slash).

Therefore unquoted TXT data should be treated as the first contiguous character string of 1 to 255 characters following the TXT type declaration, and quoted TXT data should be treated as any contiguous character string of 1 to 255 characters, inside quotes.

At the moment unquoted TXT is limited to a regular expression that still includes many allowable characters, which should instead be changed to allow any non whitespace, however trying to make this change currently breaks the spec.

aeden avatar Nov 24 '22 16:11 aeden