mDNS queries sent via unicast connection instead of multicast - causes discovery failures for certain devices
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 225
- Avg merge
- 15h 34m
- Merged PRs (30d)
- 3
Description
### Problem
The [`sendQuery` function](https://github.com/hashicorp/mdns/blob/main/client.go#L402) (lines 402-420) sends mDNS queries using **unicast** connections instead of multicast connections.
### Impact
Some devices, e.g. the Alfen EV Charger only responds to queries sent via multicast
### RFC Compliance
According to RFC 6762 (Multicast DNS), service discovery queries should be sent to the multicast address (224.0.0.251 for IPv4, ff02::fb for IPv6). While the library correctly sends to ipv4Addr (which is the multicast address), it uses a unicast socket to do so, which some devices may filter or ignore.
### Question
Should mDNS queries be sent via the multicast connections ipv4MulticastConn/ipv6MulticastConn instead of unicast connections for better compatibility? Or is there a fork that already does this?
Contributor guide
Research direction
Start in client.go at sendQuery (lines 402-420), then trace how ipv4MulticastConn, ipv6MulticastConn, and the unicast connections are initialized and used. Confirm the RFC and device-compatibility implications, with completion defined as selecting the appropriate query transport and verifying discovery behavior for IPv4 and IPv6.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100