[GH-ISSUE #1671] NsLookup only gives names, but no addresses #732

Closed
opened 2026-03-16 00:02:55 +03:00 by kerem · 1 comment
Owner

Originally created by @db48x on GitHub (Mar 29, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1671

Describe the bug
When looking up name servers for a domain, the response includes records for both the names of the nameservers and their addresses, but trust-dns-resolver only makes the names available.

To Reproduce

    let ns = system_resolver.ns_lookup(domain).await?;
    let _r: Vec<_> = ns.as_lookup().record_iter().inspect(|r| {dbg!(r);}).collect();
    let _n: Vec<_> = ns.iter().inspect(|n| {dbg!(n);}).collect();

Expected behavior
I expect ns.iter() to iterate over the Names from the response, as indicated by the type signature; that part is fine. However, I expected that I could get the additional address records from ns.as_lookup().record_iter(). Instead only NS records are available.

System:

  • OS: LInux
  • Architecture: x86_64
  • Version: Fedora 34
  • rustc version: 1.59.0-nightly

Version:
Crate: resolver
Version: 0.22.1

Originally created by @db48x on GitHub (Mar 29, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1671 **Describe the bug** When looking up name servers for a domain, the response includes records for both the names of the nameservers and their addresses, but trust-dns-resolver only makes the names available. **To Reproduce** ```rust let ns = system_resolver.ns_lookup(domain).await?; let _r: Vec<_> = ns.as_lookup().record_iter().inspect(|r| {dbg!(r);}).collect(); let _n: Vec<_> = ns.iter().inspect(|n| {dbg!(n);}).collect(); ``` **Expected behavior** I expect `ns.iter()` to iterate over the `Name`s from the response, as indicated by the type signature; that part is fine. However, I expected that I could get the additional address records from `ns.as_lookup().record_iter()`. Instead only NS records are available. **System:** - OS: LInux - Architecture: x86_64 - Version: Fedora 34 - rustc version: 1.59.0-nightly **Version:** Crate: resolver Version: 0.22.1
kerem closed this issue 2026-03-16 00:03:00 +03:00
Author
Owner

@db48x commented on GitHub (Mar 29, 2022):

This appears to be caused by handle_noerror in crates/resolver/src/caching_client.rs. The address records are definitely present in the response_message, but they get filtered out because the record type (A or AAAA) does not match the query type (NS). There are special cases here for CNAME records and SRV queries; perhaps there should be one for NS queries too?

<!-- gh-comment-id:1081662893 --> @db48x commented on GitHub (Mar 29, 2022): This appears to be caused by `handle_noerror` in [crates/resolver/src/caching_client.rs](https://github.com/bluejekyll/trust-dns/blob/v0.21.1/crates/resolver/src/caching_client.rs#L300). The address records are definitely present in the `response_message`, but they get filtered out because the record type (A or AAAA) does not match the query type (NS). There are special cases here for CNAME records and SRV queries; perhaps there should be one for NS queries too?
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#732
No description provided.