Score:0

avahi-browse cannot find all local computers although mDNS is working

fk flag

I am reading the following procedure: How can I discover the hostnames for all the machines on my lan? .

However, when I tried the command avahi-browse -av -d local, it showed the followings, although many more computers (with avahi enabled) are connected in the local network.

Server version: avahi 0.8; Host name: mycomputer.local
E Ifce Prot Name                                          Type                 Domain
+ ZZZZZZZZZ IPv4 anothercomputer1 [XX:XX:XX:XX:XX:XX]     Workstation          local
+ ZZZZZZZZZ IPv4 anothercomputer2 [XX:XX:XX:XX:XX:XX]     Workstation          local
+ ZZZZZZZZZ IPv4 anothercomputer3 [XX:XX:XX:XX:XX:XX]     Workstation          local
: Cache exhausted
: All for now

In addition, I can connect computers that are not shown above via mDNS, for example, ssh anothercomputer10.local works.

How should I do to find all local computers via avahi?

Score:0
cn flag

Hiro,

I had the same problem as you when using avahi-browse to search for a host on my LAN using mDNS. In my case it was a Raspberry Pi with avahi running. I could ping the Pi with ping raspberrypi.local successfully. I could even ssh with the local domain: ssh pi@raspberrypi.local.

When I ran avahi-browse initially I was getting a few different hosts on my network (media centres, TV boxes, etc.) but not the Raspberry Pi running Avahi.

The solution for me was to edit avahi-daemon.conf on the Pi and ensure this option is set to "yes":

[publish]
publish-workstation=yes

After saving that file I restarted the avahi daemon: sudo systemctl restart avahi-daemon

Now when I run avahi-browse on my PC to look for the Raspberry Pi I can see it in the results:

E Ifce Prot Name                                          Type                 Domain
+ wlp4s0 IPv6 raspberrypi [xx:xx]               Workstation          local
+ wlp4s0 IPv4 raspberrypi [xx:xx]               Workstation          local
+ wlp4s0 IPv4 otherdevice                             Web Site             local
: Cache exhausted
: All for now

Apparently it is a privacy feature of avahi to have the workstation flag set to "no". I suppose it is like why some Bluetooth devices do not make themselves "discoverable".

I hope this helps.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.