[GH-ISSUE #1389] Parsing truncated DNS responses can produce 3 different errors #664

Open
opened 2026-03-15 23:44:14 +03:00 by kerem · 2 comments
Owner

Originally created by @saethlin on GitHub (Feb 26, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1389

There are apparently DNS servers which return responses that are truncated, but do not set the truncated bit. This results in one of these three errors, depending on where the truncation occurs:

ProtoError { kind: Msg("rdata length too large for remaining bytes, need: 46 remain: 2") }
ProtoError { kind: Message("buffer exhausted") }
ProtoError { kind: Message("unexpected end of input reached") }

It would be nice if these were all the same type so that software could react to this situation. Unfortunately I don't know that this is visible in the resolver, and I haven't (yet?) noticed any such responses coming from public DNS servers.

Originally created by @saethlin on GitHub (Feb 26, 2021). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1389 There are apparently DNS servers which return responses that are truncated, but do not set the truncated bit. This results in one of these three errors, depending on where the truncation occurs: ``` ProtoError { kind: Msg("rdata length too large for remaining bytes, need: 46 remain: 2") } ProtoError { kind: Message("buffer exhausted") } ProtoError { kind: Message("unexpected end of input reached") } ``` It would be nice if these were all the same type so that software could react to this situation. Unfortunately I don't know that this is visible in the resolver, and I haven't (yet?) noticed any such responses coming from public DNS servers.
Author
Owner

@bluejekyll commented on GitHub (Feb 28, 2021):

Is this related at all to your testing? #1384

<!-- gh-comment-id:787216538 --> @bluejekyll commented on GitHub (Feb 28, 2021): Is this related at all to your testing? #1384
Author
Owner

@saethlin commented on GitHub (Feb 28, 2021):

I don't think it's related. Our application in this case is purely passive; we're trying trying to parse DNS traffic which is observed by a network sensor, and not necessarily produced by trust-dns.

<!-- gh-comment-id:787402124 --> @saethlin commented on GitHub (Feb 28, 2021): I don't think it's related. Our application in this case is purely passive; we're trying trying to parse DNS traffic which is observed by a network sensor, and not necessarily produced by trust-dns.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#664
No description provided.