0

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?

1 Answer 1

0

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 [email protected].

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.

1
  • Thank you. publish-workstation=yes worked well. (I worked with this issue with another workaround, but recently tried this.)
    – H.Hiro
    Nov 27, 2023 at 5:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .