[GH-ISSUE #2931] 0.24 -> 0.25 migration path for query() #1091

Closed
opened 2026-03-16 01:35:27 +03:00 by kerem · 3 comments
Owner

Originally created by @pronebird on GitHub (Apr 14, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2931

In v0.24 MessageRequest::query() would return a single LowerQuery.

However in v0.25 MessageRequest::queries() was introduced, which returns a slice &[LowerQuery]

What's the correct migration path here, why are there many queries, when there used to be only one?

Thank you.

Originally created by @pronebird on GitHub (Apr 14, 2025). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2931 In v0.24 [`MessageRequest::query()`](https://docs.rs/hickory-server/0.24.4/src/hickory_server/authority/message_request.rs.html#94-96) would return a single `LowerQuery`. However in v0.25 [`MessageRequest::queries()`](https://docs.rs/hickory-server/latest/src/hickory_server/authority/message_request.rs.html#92-94) was introduced, which returns a slice `&[LowerQuery]` What's the correct migration path here, why are there many queries, when there used to be only one? Thank you.
kerem closed this issue 2026-03-16 01:35:32 +03:00
Author
Owner

@pronebird commented on GitHub (Apr 14, 2025):

After reading a bit. I assume nobody really supports multiple queries in one message, so I can pick the first query and ignore the rest. Potentially print a message in the log just in case I need to revisit this.

<!-- gh-comment-id:2802480114 --> @pronebird commented on GitHub (Apr 14, 2025): After [reading a bit](https://serverfault.com/a/742788). I assume nobody really supports multiple queries in one message, so I can pick the first query and ignore the rest. Potentially print a message in the log just in case I need to revisit this.
Author
Owner

@divergentdave commented on GitHub (Apr 14, 2025):

This was changed in PR #2729. This field reflects the question section of a DNS message. For messages with the QUERY opcode, there will typically be one query. Clients may send a message with the QUERY opcode and zero queries if they support DNS cookies and are trying to prefetch a server cookie. For other opcodes, the rules around the number of queries may vary. See RFC 9619 for more information.

Making this change allowed us to fix the precedence of some error codes, by making the MessageRequest data structure less restrictive. This change also makes it easier to possibly support DNS cookies in the future.

If you're just handling the QUERY opcode, you can check the number of queries you get in a MessageRequest and send a FORMERR response as appropriate.

<!-- gh-comment-id:2802496182 --> @divergentdave commented on GitHub (Apr 14, 2025): This was changed in PR #2729. This field reflects the question section of a DNS message. For messages with the `QUERY` opcode, there will typically be one query. Clients may send a message with the `QUERY` opcode and zero queries if they support DNS cookies and are trying to prefetch a server cookie. For other opcodes, the rules around the number of queries may vary. See [RFC 9619](https://www.rfc-editor.org/rfc/rfc9619.html) for more information. Making this change allowed us to fix the precedence of some error codes, by making the `MessageRequest` data structure less restrictive. This change also makes it easier to possibly support DNS cookies in the future. If you're just handling the `QUERY` opcode, you can check the number of queries you get in a `MessageRequest` and send a `FORMERR` response as appropriate.
Author
Owner

@pronebird commented on GitHub (Apr 14, 2025):

This was changed in PR #2729. This field reflects the question section of a DNS message. For messages with the QUERY opcode, there will typically be one query. Clients may send a message with the QUERY opcode and zero queries if they support DNS cookies and are trying to prefetch a server cookie. For other opcodes, the rules around the number of queries may vary. See RFC 9619 for more information.

Making this change allowed us to fix the precedence of some error codes, by making the MessageRequest data structure less restrictive. This change also makes it easier to possibly support DNS cookies in the future.

If you're just handling the QUERY opcode, you can check the number of queries you get in a MessageRequest and send a FORMERR response as appropriate.

Makes sense. Thanks you.

<!-- gh-comment-id:2802755916 --> @pronebird commented on GitHub (Apr 14, 2025): > This was changed in PR [#2729](https://github.com/hickory-dns/hickory-dns/pull/2729). This field reflects the question section of a DNS message. For messages with the `QUERY` opcode, there will typically be one query. Clients may send a message with the `QUERY` opcode and zero queries if they support DNS cookies and are trying to prefetch a server cookie. For other opcodes, the rules around the number of queries may vary. See [RFC 9619](https://www.rfc-editor.org/rfc/rfc9619.html) for more information. > > Making this change allowed us to fix the precedence of some error codes, by making the `MessageRequest` data structure less restrictive. This change also makes it easier to possibly support DNS cookies in the future. > > If you're just handling the `QUERY` opcode, you can check the number of queries you get in a `MessageRequest` and send a `FORMERR` response as appropriate. Makes sense. Thanks you.
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#1091
No description provided.