add NSEC record to debug resolve issue #183
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch is to help debugging issue #182 .
Testing with this patch, it shows that python zeroconf publishes a DNS RR
NSEC
record (type 47) that indicates the absence of address records:[2024-03-18T05:21:14Z DEBUG mdns_sd::dns_parser] DnsNSec { record: DnsRecord { entry: DnsEntry { name: "worky-station._workstation._tcp.local.", ty: 47, class: 1, unique: true }, ttl: 120, created: 1710739274570, expires: 1710739394570, refresh: 1710739370570 }, next_domain: "worky-station._workstation._tcp.local.", bitmap: [64, 0, 0, 8] }
The
bitmap
has 2 bits set: bit 1 (TYPE_A) and bit 28 (TYPE_AAAA) for Ipv4 and Ipv6 address records absence. This is the reason why the current mdns-sd lib cannot resolve its addresses.(This patch added logging facility so that we can do this:
$ RUST_LOG=debug cargo run --example query _workstation._tcp
)UPDATE: added logic to lookup for addresses if the responder providesNSEC
record announcing lack of address info.UPDATE: keep the
DnsNSec
record definition for future use. Also added a simple test case.