Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add NSEC record to debug resolve issue #183

Merged
merged 6 commits into from
Mar 24, 2024
Merged

add NSEC record to debug resolve issue #183

merged 6 commits into from
Mar 24, 2024

Conversation

keepsimple1
Copy link
Owner

@keepsimple1 keepsimple1 commented Mar 18, 2024

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 provides NSEC record announcing lack of address info.

UPDATE: keep the DnsNSec record definition for future use. Also added a simple test case.

@keepsimple1 keepsimple1 changed the title support NSEC record to debug resolve issue add NSEC record to debug resolve issue Mar 24, 2024
@keepsimple1 keepsimple1 merged commit 5d74118 into main Mar 24, 2024
3 checks passed
@keepsimple1 keepsimple1 deleted the debug-resolve branch March 24, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant