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 entry more than 255 characters will cause SERVFAIL #1566

Open
matiniamirhossein opened this issue May 3, 2024 · 1 comment
Open

TXT entry more than 255 characters will cause SERVFAIL #1566

matiniamirhossein opened this issue May 3, 2024 · 1 comment

Comments

@matiniamirhossein
Copy link

Hello,

I wanted to know if there is any solution to send responses more than 255 characters other than splitting them into multiple responses?

Or at least send them in one response if separated:

Response when more than 255 characters:

; <<>> DiG 9.10.6 <<>> @localhost -p 5003 -t txt example.com
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 40878
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
; example.com.           IN      TXT

;; Query time: 1 msec
;; SERVER: 127.0.0.1#5003(127.0.0.1)
;; WHEN: Fri May 03 23:26:48
;; MSG SIZE  rcvd: 37

Separated each 255 chars txt response:

;; ANSWER SECTION:
example.com.    900     IN      TXT     "DTjg7c+PQ+3UaEkZyF5wNOrxdLf4acWleZBb23pScEXPrF35DkLGajur7aUILYSKd2xTuG96bRzGhSmv/79eV9iAlh2FntHvU317Y5yMTJjHbJ6Di7uYBm6TT7o/WYEgjd4jUUbEjEhLpPNSu6mC8pQxzw9vSHhnAjt7Bl+BcImQSVlqVGTTcyqM0hPHankwLPZX2JJJwbmKAIGpJIb6d0PJvgDfSuDwizAHKs4JLXa5+WV7wwY8UKi+l0S2yCG"
example.com.    900     IN      TXT     "670138636944419053743028302293916462782093931773842086509700182855525152055471340011472=="

Cloudns response:

; <<>> DiG 9.16.48-Ubuntu <<>> -t txt example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50129
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
; example.com.           IN      TXT

;; ANSWER SECTION:
example.com.    60      IN      TXT     "DTjg7c+PQ+3UaEkZyF5wNOrxdLf4acWleZBb23pScEXPrF35DkLGajur7aUILYSKd2xTuG96bRzGhSmv/79eV9iAlh2FntHvU317Y5yMTJjHbJ6Di7uYBm6TT7o/WYEgjd4jUUbEjEhLpPNSu6mC8pQxzw9vSHhnAjt7Bl+BcImQSVlqVGTTcyqM0hPHankwLPZX2JJJwbmKAIGpJIb6d0PJvgDfSuDwizAHKs4JLXa5+WV7wwY8UKi+l0S2yCG" "670138636944419053743028302293916462782093931773842086509700182855525152055471340011472=="

I do know that there is no difference in processing them but in golang for example we have to join 2 separate txt lookups.

@gibson042
Copy link
Collaborator

The definition of TXT RDATA is "One or more <character-string>s", i.e. a sequence in which each element is a <character-string> (which itself is "a single length octet followed by that number of characters… can be up to 256 characters in length (including the length octet)"). Not only is a single string with more than 255 octets of content invalid, it would be literally impossible to represent in wire format.

See also #422 (which would have done a better job surfacing the underlying issue but was ultimately rejected) and #1428.

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

2 participants