cnlohr / minimdnsd

Simple, dependency-less, and low-overhead MDNS server for Linux
MIT License
61 stars 3 forks source link

Resolve AAAA over IPv4 returns multicast address as IPv4-mapped IPv6 address #6

Open HeMan opened 4 months ago

HeMan commented 4 months ago

When resolving an AAAA record over IPv4 it returns the multicast address (224.0.0.251) as an IPv4-mapped IPv6 addres (::ffff:224.0.0.251).

22:59:20.130533 IP 192.168.2.23.5353 > 224.0.0.251.5353: 0 AAAA (QM)? suxhost.local. (31)
22:59:20.133211 IP 192.168.2.24.5353 > 192.168.2.23.5353: 0*- [0q] 1/0/0 (Cache flush) AAAA ::ffff:224.0.0.251 (53)

It should instead return all IPv6-addresses on that interface.

cnlohr commented 4 months ago

I am starting to think I may not want to support this - I wrote support on this branch just for one cached address. https://github.com/cnlohr/minimdnsd/commit/35b403dcbd3735e05019860d12fed7bf28d5af23 and it really uglies things up.

I am starting to think if you want to do IPv6, then request it on IPv6.

Do you have strong feelings towards this? It seems not worth it for such a specific issue.

cnlohr commented 4 months ago

Maybe it's worth it to instead of caching, just get the addresses every time...

cnlohr commented 4 months ago

Ok, I literally cannot test this. How are you getting something to request the AAAA record?

cnlohr commented 4 months ago

Ah, there's also this - https://github.com/cnlohr/minimdnsd/commit/1724dfd27557773f6c513fce415062279d9d05a0

But still, I have no way to test.

HeMan commented 4 months ago

I requested it with avahi-resolve:

$ avahi-resolve -6 -n suxhost.local
suxhost.local   ::ffff:224.0.0.251

Having /etc/nsswitch.conf contain this hosts-line does also try to resolve AAAA over IPv4 with for example ping -6

hosts:          files mdns_minimal [NOTFOUND=return] dns mymachines mdns