You are not logged in.

#1 2025-01-20 08:05:52

Monero
Member
Registered: 2022-04-18
Posts: 30

Avahi mDNS Discovery Not Working Despite Visible mDNS Traffic

Hello everyone,

I'm experiencing a frustrating issue with Avahi on my Arch Linux workstation where mDNS service discovery isn't working at all, despite visible mDNS traffic on the network. It works on Windows on the same PC (Chrome can find the Chromecast devices and cast to them). I've tried numerous troubleshooting steps without success and would appreciate any insights. Below is a detailed account of my setup, configurations, recent logs, and steps taken so far.

System Information:
- OS: Arch Linux x86_64
- Kernel: 6.12.9-arch1-1
- Network Interface: wlp4s0 (wireless)
- mDNS Tool: Avahi 0.8
- Firewall: firewalld (configured, but disabled during tests)
- Other Software: Google Chrome (which binds port 5353)

---

Avahi Configuration (/etc/avahi/avahi-daemon.conf):

[server]
use-ipv4=yes
use-ipv6=no
allow-interfaces=wlp4s0
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
publish-hinfo=no
publish-workstation=no

[reflector]
enable-reflector=no

*(Other default settings unchanged)*

Note: I changed ipv6 to "no" after testing it earlier with "yes" to no avail

---

Troubleshooting Steps Taken:

1. Checking if mDNS traffic is present:
Running `tcpdump -i wlp4s0 udp port 5353` shows that plenty of mDNS packets are present:

02:13:03.768526 IP [REDACTED-DEVICE].mdns > mdns.mcast.net.mdns: 430 ANY (QM)? _matterc._udp.local. (37)
02:13:04.775143 IP [REDACTED-DEVICE].mdns > mdns.mcast.net.mdns: 431 ANY (QM)? _matterc._udp.local. (37)
02:13:16.320014 IP Chromecast.mdns > mdns.mcast.net.mdns: 0 PTR (QM)? _googlecast._tcp.local. (40)
02:13:16.320014 IP Chromecast.mdns > mdns.mcast.net.mdns: 0*- [0q] 1/0/3 PTR Chromecast-[REDACTED]._googlecast._tcp.local. (357)

This confirms that mDNS traffic is present on my network.

2. Checking what’s binding to port 5353:
Running `sudo lsof -i UDP:5353 -n -P`:

COMMAND     PID  USER  FD   TYPE DEVICE SIZE/OFF NODE NAME
chrome     5113   [REDACTED] 107u  IPv4  60979      0t0  UDP 224.0.0.251:5353
avahi-dae 10274 avahi  12u  IPv4  48818      0t0  UDP *:5353

This confirmed a conflict: Chrome was binding to port 5353 alongside Avahi.

3. Addressing Chrome Conflict:
- Killed Chrome (`pkill -f chrome`).
- Verified that Avahi was the only process bound to port 5353.
- Despite this, Avahi still did not list services.

4. Checking Avahi Status:

● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; preset: disabled)
     Active: active (running) since Mon 2025-01-20 02:38:38 EST; 5s ago
 Invocation: 52079bcb564149efae08b9583ee85834
TriggeredBy: ● avahi-daemon.socket
   Main PID: 10274 (avahi-daemon)
     Status: "avahi-daemon 0.8 starting up."
      Tasks: 2 (limit: 76902)
     Memory: 784K (peak: 1.6M)
        CPU: 7ms
     CGroup: /system.slice/avahi-daemon.service
             ├─10274 "avahi-daemon: running [REDACTED-HOSTNAME]"
             └─10275 "avahi-daemon: chroot helper"

5. Checking Avahi Logs:

Jan 20 02:37:46 [REDACTED-HOSTNAME] avahi-daemon[10076]: Joining mDNS multicast group on interface wlp4s0.IPv4 with address 192.168.1.129.
Jan 20 02:37:46 [REDACTED-HOSTNAME] avahi-daemon[10076]: New relevant interface wlp4s0.IPv4 for mDNS.
Jan 20 02:37:46 [REDACTED-HOSTNAME] avahi-daemon[10076]: Network interface enumeration completed.
Jan 20 02:37:46 [REDACTED-HOSTNAME] avahi-daemon[10076]: Registering new address record for REDACTED on wlp4s0.*.
Jan 20 02:37:46 [REDACTED-HOSTNAME] avahi-daemon[10076]: Registering new address record for 192.168.1.129 on wlp4s0.IPv4.

6. Testing Service Discovery:
Running `avahi-browse -a`:

Got SIGINT, quitting.

Nothing is found.

Running `mdns-scan`:

Browsing ... -

Again, nothing is found.

7. Checking Firewall Configuration:
Disabled firewalld:

sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service

No improvement.

8. Checking for other active mDNS daemons:

pgrep -laf mdns
pgrep -laf bonjour

Both returned nothing.

9. Ensuring nss-mdns is installed:

pacman -Qe | grep -Ei 'dns|mdns|avahi|nss|bonjour|zeroconf'

Returns:

libmicrodns 0.2.0-2
nss-mdns 0.15.1-2
openssh 9.9p1-2

It is installed.

10. Checking resolv.conf:

cat /etc/resolv.conf

Returns:

# Generated by NetworkManager
search Home
nameserver 192.168.1.1

Looks fine.

11. Disabling Everything:
Disabled firewall, stopped NetworkManager, closed Chrome, and restarted Avahi.
Still nothing.

---

Key Observations:
- It works on Windows on the same PC (Chrome can find the Chromecast devices and cast to them)
- mDNS packets are clearly present on the network.
- Avahi starts successfully but never discovers any services.
- `mdns-scan` also fails to list services despite network traffic.
- The persistent warning about another IPv4 mDNS stack suggests a conflict (from Chome), but even after eliminating Chrome, the issue persisted.

I faintly seem to remember that this used to work a few years ago (I haven't reinstalled arch in a long time), so it's totally possible that I installed some program in the meantime that limited this functionality and/or affects Avahi. If so, are there any specific programs to look for?

What additional debugging steps or configurations might isolate this problem further? Any ideas to solve this are welcome. Thank you!

Offline

#2 2025-01-20 11:46:38

-thc
Member
Registered: 2017-03-15
Posts: 803

Re: Avahi mDNS Discovery Not Working Despite Visible mDNS Traffic

Did you follow the Wiki's instructions regarding "nsswitch.conf"?
https://wiki.archlinux.org/title/Avahi# … resolution

Offline

#3 2025-01-20 18:52:30

Monero
Member
Registered: 2022-04-18
Posts: 30

Re: Avahi mDNS Discovery Not Working Despite Visible mDNS Traffic

Hi, yes, sorry it was late. I did everything that was on https://wiki.archlinux.org/title/Avahi (and discussion), to no avail. These are the config changes I tried:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
# hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 workstation
# hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
# hosts: mymachines mdns [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns

Hostname is "workstation". I actually had it as "local" before, so it could be that this screwed things up - but that was the very first thing I fixed and it lead to no improvement. I also reinstalled Avahi and all the other programs of course.

Offline

Board footer

Powered by FluxBB