keepsimple1 / mdns-sd

Rust library for mDNS based Service Discovery
Apache License 2.0
87 stars 38 forks source link

Reverse DNS lookup query #225

Open sinhpham opened 1 month ago

sinhpham commented 1 month ago

I'm getting multiple reverse DNS lookup queries, but mdns-sd is not responding to them. As a result, my other device could not resolve and connect to the mdns service.

Here's the log I'm getting

question: DnsQuestion { entry: DnsEntry { name: "155.1.168.192.in-addr.arpa.", ty: 12, class: 1, unique: false} }

Is mdns-sd supposed to handle those queries? The RFC mentioned "reverse address mapping"[1] made me think this is pretty standard and expected. But I'm not sure if mdns-sd itself should handle those queries or something else should.

I could work on a PR if this is needed in mdns-sd

[1] https://datatracker.ietf.org/doc/html/rfc6762#section-4

keepsimple1 commented 1 month ago

Currently mdns-sd does not handle reverse DNS lookups mainly because it's not normally needed for "service discovery". And, it seems the RFC only mentioned the link local addresses reverse lookups sent to mDNS, not private network addresses like 192.168.0.0/16 in your example.

Any DNS query for a name ending with "254.169.in-addr.arpa." MUST
      be sent to the mDNS IPv4 link-local multicast address 224.0.0.251
      or the mDNS IPv6 multicast address FF02::FB.  Since names under
      this domain correspond to IPv4 link-local addresses, it is logical
      that the local link is the best place to find information
      pertaining to those names.

The RFC section is fairly short. If you have other pointers about what mdns servers support regarding reverse lookups, or more details about your use case, it will help me to better understand if it fits in mdns-sd.