<div dir="ltr">Package: libnss-mdns<br>Version: 0.15.1-4+b1<br>Severity: important<br>Tags: trixie<br><br>mDNS name resolution via libnss-mdns is completely broken on Debian trixie<br>with glibc 2.41. The NSS module is loaded but never called, causing .local<br>hostnames to fall through to DNS instead of being resolved via mDNS.<br><br>** Background **<br><br>glibc 2.41 changed NSS module loading to resolve all possible NSS function<br>symbols at load time (not just the ones relevant to the requested database).<br>Since libnss-mdns only provides hosts-related functions, glibc fails to find<br>symbols like _nss_mdns4_minimal_getpwnam_r, _nss_mdns4_minimal_getgrent_r,<br>etc., and marks every missing symbol as "fatal". As a result, the module is<br>effectively treated as UNAVAIL, and the [NOTFOUND=return] directive in<br>nsswitch.conf is never triggered.<br><br>** Steps to reproduce **<br><br>1. Install libnss-mdns and avahi-daemon on Debian trixie (glibc 2.41).<br>2. Ensure /etc/nsswitch.conf contains:<br>   hosts: files mdns4_minimal [NOTFOUND=return] dns<br>3. Have another host advertising via mDNS on the local network.<br>4. Run: getent hosts <hostname>.local<br><br>** Expected result **<br><br>The .local hostname is resolved via mDNS (e.g., 192.168.0.25).<br><br>** Actual result **<br><br>The hostname is resolved via DNS, returning an incorrect address (in my case,<br>an ISP DNS hijacking address 218.38.137.27 instead of 192.168.0.25).<br><br>** Diagnosis **<br><br>avahi-daemon and the avahi socket work correctly:<br><br>  $ avahi-resolve -4 -n pluto.local<br>  pluto.local     192.168.0.25<br><br>  $ echo "RESOLVE-HOSTNAME-IPV4 pluto.local" | nc -U /run/avahi-daemon/socket<br>  + 2 0 pluto.local 192.168.0.25<br><br>But NSS-based resolution bypasses mDNS entirely:<br><br>  $ getent hosts pluto.local<br>  218.38.137.27   pluto.local<br><br>strace confirms the .so files are loaded but no avahi socket connection is<br>attempted — the process goes straight to DNS:<br><br>  $ strace -e trace=openat,connect getent hosts pluto.local<br>  (opens libnss_mdns4_minimal.so.2 successfully)<br>  (opens libnss_mdns6_minimal.so.2 successfully)<br>  (no AF_UNIX connect to /run/avahi-daemon/socket)<br>  (connects to DNS server on port 53)<br><br>LD_DEBUG reveals the root cause — glibc tries to resolve all NSS functions<br>and marks each missing one as fatal:<br><br>  $ LD_DEBUG=symbols getent hosts pluto.local 2>&1 | grep fatal | head -5<br>  symbol=_nss_mdns4_minimal_endaliasent; ... undefined symbol (fatal)<br>  symbol=_nss_mdns4_minimal_endetherent; ... undefined symbol (fatal)<br>  symbol=_nss_mdns4_minimal_endgrent; ... undefined symbol (fatal)<br>  symbol=_nss_mdns4_minimal_endhostent; ... undefined symbol (fatal)<br>  symbol=_nss_mdns4_minimal_endnetent; ... undefined symbol (fatal)<br><br>The library only exports hosts-related symbols, which is expected:<br><br>  $ nm -D /lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 | grep ' T '<br>  _nss_mdns4_minimal_gethostbyaddr_r<br>  _nss_mdns4_minimal_gethostbyname2_r<br>  _nss_mdns4_minimal_gethostbyname3_r<br>  _nss_mdns4_minimal_gethostbyname4_r<br>  _nss_mdns4_minimal_gethostbyname_r<br><br>Note: The same libnss-mdns version works correctly on Ubuntu 24.04 which<br>ships glibc 2.39, confirming that this is a glibc 2.41 compatibility issue.<br><br>** Possible fix **<br><br>Either libnss-mdns needs to be rebuilt/patched to be compatible with glibc<br>2.41's new module loading behavior, or this may need to be addressed on the<br>glibc side as a backward compatibility regression. I'm filing against<br>libnss-mdns first, but please reassign to glibc if appropriate.<br><br><br>-- System Information:<br>Debian Release: 13.3<br>  APT prefers stable-updates<br>  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')<br>Architecture: amd64 (x86_64)<br><br>Kernel: Linux 6.12.63+deb13-amd64 (SMP w/2 CPU threads; PREEMPT)<br>Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en<br>Shell: /bin/sh linked to /usr/bin/dash<br>Init: systemd (via /run/systemd/system)<br>LSM: AppArmor: enabled<br><br>Versions of packages libnss-mdns depends on:<br>ii  libc6  2.41-12+deb13u1<br><br>Versions of packages libnss-mdns recommends:<br>ii  avahi-daemon  0.8-16<br><br>Versions of packages libnss-mdns suggests:<br>ii  avahi-autoipd  0.8-16<br><br>-- no debconf information</div>