[GH-ISSUE #1745] Allow access to lookup's record slice #757

Closed
opened 2026-03-16 00:09:09 +03:00 by kerem · 2 comments
Owner

Originally created by @izissise on GitHub (Jul 20, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1745

Is your feature request related to a problem? Please describe.
I'd like to choose to randomly choose an ip when the response for a domain contains multiple answers,
right now the only way is to .iter().collect() on Lookup

Describe the solution you'd like
Lookup already have a records methods, but it exist only for testing, it would be nice if it was available to use.

Originally created by @izissise on GitHub (Jul 20, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1745 **Is your feature request related to a problem? Please describe.** I'd like to choose to randomly choose an ip when the response for a domain contains multiple answers, right now the only way is to `.iter().collect()` on [Lookup](https://docs.rs/trust-dns-resolver/0.21.2/trust_dns_resolver/lookup/struct.Lookup.html#) **Describe the solution you'd like** `Lookup` already have a [records](https://docs.rs/trust-dns-resolver/0.21.2/src/trust_dns_resolver/lookup.rs.html#103) methods, but it exist only for testing, it would be nice if it was available to use.
kerem closed this issue 2026-03-16 00:09:14 +03:00
Author
Owner

@djc commented on GitHub (Jul 25, 2022):

I think it might make sense to just expose records(). Would you be able to contribute a PR for this?

<!-- gh-comment-id:1193844540 --> @djc commented on GitHub (Jul 25, 2022): I think it might make sense to just expose `records()`. Would you be able to contribute a PR for this?
Author
Owner

@bluejekyll commented on GitHub (Aug 5, 2022):

Resolved in #1746

<!-- gh-comment-id:1206804695 --> @bluejekyll commented on GitHub (Aug 5, 2022): Resolved in #1746
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#757
No description provided.