You are not logged in.

#1 2022-11-30 16:36:22

lugge
Member
Registered: 2017-03-17
Posts: 33

issues with zeroconf (avahi)

Hi there,

I have a private network consisting of about 10 hosts.
Most of them are Debian VMs running on a small server, two of them are Arch linux laptop and desktop PC.

Because I don't want to remember IP addresses, I use avahi on all machines.
For example, my desktop is called "lugge-desktop", thus, I can ssh and ping this machine using lugge-desktop.local as name.

Basically this is working.
Every machine in the network can ping every other machine by its name.
However, my Arch-based desktop PC makes trouble.
It seems to "forget" the name resolution every few minutes.
In this case, my desktop cannot be reached from other machines (except via IP) nor can it reach other machines.

This is a matter of a few 10 seconds or minutes.
One ping or ssh would work, 1min later it will no longer work. Another minute again, it may work again.

The weird thing: my Arch based laptop and PC are using the exact same avahi conf.
However, I do not have these issues on the laptop.
Another weird thing: other machines can't reach my desktop in this period of time. I wonder why because I thought they would have a network name cache.
I can ensure that my desktop is available in network because using IP addresses, no issues occure.

/etc/nssswitch.conf:

# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files systemd
group: files [SUCCESS=merge] systemd
shadow: files systemd
gshadow: files systemd

publickey: files

hosts: files mymachines myhostname mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

/etc/avahi/avahi-daemon.conf:

# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

# See avahi-daemon.conf(5) for more information on this configuration
# file!

[server]
#host-name=foo
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

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

[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
publish-hinfo=no
publish-workstation=no
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
#enable-reflector=no
#reflect-ipv=no
#reflect-filters=_airplay._tcp.local,_raop._tcp.local

[rlimits]
#rlimit-as=
#rlimit-core=0
#rlimit-data=8388608
#rlimit-fsize=0
#rlimit-nofile=768
#rlimit-stack=8388608
#rlimit-nproc=3

Both machines have avahi-daemon and systemd-resolved enabled and running without issues in the log.

Any ideas how to proceed?

Offline

#2 2022-11-30 17:08:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: issues with zeroconf (avahi)

Afaik systemd-resolved and avahi-daemon are in direct conflict and will both want to do the same thing. https://wiki.archlinux.org/title/Avahi#Installation disable systemd-resolved

Offline

#3 2022-11-30 17:58:47

lugge
Member
Registered: 2017-03-17
Posts: 33

Re: issues with zeroconf (avahi)

Already tried without systemd-resolved for a few days.
It does not make any difference.
I just activated it again because on my Arch laptop, where no issues are present, they are both running. Wanted to make the same environment again.

I'm now trying do debug this problem.
There are times where name resolution works, and times when not.

When its working, and I can ping or ssh and stuff, is there a way of checking WHO or HOW the names are resolved?
Some, don't know, resolver log or the like?
So I could compare it when it's working and when not.

Offline

#4 2022-11-30 21:39:56

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: issues with zeroconf (avahi)

It would make more sense to disable systemd-resolve on the laptop than to enable services which are known to conflict on the other machine.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2022-12-01 00:37:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: issues with zeroconf (avahi)

Check the journal for the affected time frame e.g.

sudo journalctl -b

for the current boot maybe filter for avahi/resolved : https://wiki.archlinux.org/title/System … ing_output maybe also post the  output so we can take a look as well.

Offline

#6 2022-12-01 09:17:26

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: issues with zeroconf (avahi)

I have a private network consisting of about 10 hosts.

Because I don't want to remember IP addresses, I use avahi on all machines.

I'd suggest to use the (likely) routers DNS for this, but I'm not a masochist.

In this case, my desktop cannot be reached from other machines (except via IP) nor can it reach other machines.

Can it "reach" (I hope that means "ping"?) other machines via IP?
What's the output of

host -t SOA local

when things work and when they don't?

Offline

#7 2022-12-01 12:35:37

lugge
Member
Registered: 2017-03-17
Posts: 33

Re: issues with zeroconf (avahi)

seth wrote:

Can it "reach" (I hope that means "ping"?) other machines via IP?
What's the output of

host -t SOA local

when things work and when they don't?

Sure it means ping, ssh and the like, as stated in my first comment.
And yes, accessing other machines (and being accessed by others) via IP is working all the time.

The output is

local has no SOA record

And I get the exact same output whether ping by name is working or not.
Also, the output is the same on my laptop where no issues are.

And the avahi-related output of journalctl:

Dez 01 09:32:22 lugge-nuc systemd[1]: Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
Dez 01 09:32:22 lugge-nuc systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Found user 'avahi' (UID 974) and group 'avahi' (GID 974).
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Successfully dropped root privileges.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: avahi-daemon 0.8 starting up.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Successfully called chroot().
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Successfully dropped remaining capabilities.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: No service file found in /etc/avahi/services.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Joining mDNS multicast group on interface lo.IPv6 with address ::1.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: New relevant interface lo.IPv6 for mDNS.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: New relevant interface lo.IPv4 for mDNS.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Network interface enumeration completed.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Registering new address record for ::1 on lo.*.
Dez 01 09:32:22 lugge-nuc avahi-daemon[508]: Registering new address record for 127.0.0.1 on lo.IPv4.
Dez 01 09:32:22 lugge-nuc systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Dez 01 09:32:23 lugge-nuc avahi-daemon[508]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::626d:60c6:190c:4796.
Dez 01 09:32:23 lugge-nuc avahi-daemon[508]: New relevant interface wlan0.IPv6 for mDNS.
Dez 01 09:32:23 lugge-nuc avahi-daemon[508]: Registering new address record for fe80::626d:60c6:190c:4796 on wlan0.*.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: Withdrawing address record for fe80::626d:60c6:190c:4796 on wlan0.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: Server startup complete. Host name is lugge-nuc.local. Local service cookie is 772952710.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::626d:60c6:190c:4796.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: Interface wlan0.IPv6 no longer relevant for mDNS.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::dd8:c594:410f:bce4.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: New relevant interface wlan0.IPv6 for mDNS.
Dez 01 09:32:24 lugge-nuc avahi-daemon[508]: Registering new address record for fe80::dd8:c594:410f:bce4 on wlan0.*.
Dez 01 09:32:30 lugge-nuc avahi-daemon[508]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.35.
Dez 01 09:32:30 lugge-nuc avahi-daemon[508]: New relevant interface wlan0.IPv4 for mDNS.
Dez 01 09:32:30 lugge-nuc avahi-daemon[508]: Registering new address record for 192.168.0.35 on wlan0.IPv4.

and for systemd-resolved (just for completeness, I disabled it again)

Dez 01 09:32:22 lugge-nuc systemd[1]: Starting Network Name Resolution...
Dez 01 09:32:22 lugge-nuc systemd-resolved[501]: Positive Trust Anchors:
Dez 01 09:32:22 lugge-nuc systemd-resolved[501]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Dez 01 09:32:22 lugge-nuc systemd-resolved[501]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.a>
Dez 01 09:32:22 lugge-nuc systemd-resolved[501]: Using system hostname 'lugge-nuc'.
Dez 01 09:32:22 lugge-nuc systemd[1]: Started Network Name Resolution.
Dez 01 09:32:26 lugge-nuc systemd-resolved[501]: Switching to fallback DNS server 1.1.1.1#cloudflare-dns.com.

Last edited by lugge (2022-12-01 12:53:01)

Offline

#8 2022-12-01 14:31:42

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: issues with zeroconf (avahi)

The output is

local has no SOA record

And I get the exact same output whether ping by name is working or not.

https://wiki.archlinux.org/title/Avahi# … om_working

Let's re-ensure the systemd-resolved situation when it's supposedly disabled:

resolvectl status

Offline

#9 2022-12-01 16:00:47

lugge
Member
Registered: 2017-03-17
Posts: 33

Re: issues with zeroconf (avahi)

seth wrote:

Let's re-ensure the systemd-resolved situation when it's supposedly disabled:

resolvectl status
[root@lugge-nuc ~]# resolvectl status
Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

I get the same output on my Arch laptop and on my Debian VMs.

A little offtopic:
I really want to solve this because I want to know whats up with my system and I want to understand all the network stuff going on.
However, I'm also OK with other solutions.
My router (cheap one from network provider) does not allow for further DNS settings, however, I have longtime plans for setting up a PiHole VM.
PiHole can be configured for local DNS as well.

Offline

#10 2022-12-01 16:10:25

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: issues with zeroconf (avahi)

Ok, no resolved - still host should™ report NXDOMAIN, see the avahi wiki link.

Offline

#11 2022-12-01 16:25:05

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

Re: issues with zeroconf (avahi)

The ISP resolving ".local" may also cause this: https://bugs.launchpad.net/ubuntu/+sour … bug/327362

Offline

#12 2022-12-01 20:04:55

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: issues with zeroconf (avahi)

how are you connecting to the network on the machines? systemd-networkd, Network Manager, a dhcpcd@.service?

Offline

#13 2023-08-10 10:28:36

pineout
Member
Registered: 2015-01-23
Posts: 5

Re: issues with zeroconf (avahi)

this issue had not been solved, but  I have similar problem with avahi

on "old" laptop, avahi is working, finding ssh, vnc and other services, on localhost and in lan

on "new" laptop avahi is not scanning anything, /etc/nsswitch.conf is a copy of the "old" one

systemd-resolved is disabled
resolvectl status
Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

bssh and bvnc also don't find anything

Offline

#14 2023-08-10 13:00:50

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: issues with zeroconf (avahi)

Whether you've https://wiki.archlinux.org/title/Avahi# … resolution nss-mdns installed and avahi-daemon.service enabled/running (status) and what your nsswitch.conf actually looks like is a bit more interesting that "itsdoesnotsworks!", https://bbs.archlinux.org/viewtopic.php?id=57855

Offline

#15 2023-08-10 13:11:24

pineout
Member
Registered: 2015-01-23
Posts: 5

Re: issues with zeroconf (avahi)

thanks for the reply

# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files mymachines systemd
group: files mymachines systemd
shadow: files

publickey: files

hosts: files mymachines myhostname mdns_minimal [NOTFOUND=return]  resolve [!UNAVAIL=return] dns
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

Offline

#16 2023-08-10 13:14:39

pineout
Member
Registered: 2015-01-23
Posts: 5

Re: issues with zeroconf (avahi)

avahi-daemon and avahi-discoverd are both running, avahi-discover command show a completely empty form

Offline

#17 2023-08-10 16:49:40

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: issues with zeroconf (avahi)

host -t SOA local

Any kind of netfilter?
https://wiki.archlinux.org/title/Avahi#Firewall
Can you

nmap -p 5353 localhost
nmap -p 5353 ip_of_a_host_you_expect_to_show_up

Also  try to postpone myhostname and files, ie. mimic https://wiki.archlinux.org/title/Avahi# … resolution

Offline

#18 2023-08-11 15:57:09

pineout
Member
Registered: 2015-01-23
Posts: 5

Re: issues with zeroconf (avahi)

I think you are right

nmap -p 5353 localhost
Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-11 17:51 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000074s latency).
Other addresses for localhost (not scanned): ::1

PORT     STATE  SERVICE
5353/tcp closed mdns

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds

now I must investigate which unwanted software I installed

thank you

Offline

#19 2023-08-15 13:41:27

pineout
Member
Registered: 2015-01-23
Posts: 5

Re: issues with zeroconf (avahi)

host -t SOA local
;; communications error to 192.168.1.134#53: connection refused

I am still not able to scan the LAN
udp 5353 is open as specified in the doc

Firewall
Be sure to open UDP port 5353 if you are using a firewall.
nmap -sTU 5353 localhost
Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-15 15:31 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000076s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 999 closed udp ports (port-unreach), 999 closed tcp ports (conn-refused)
PORT     STATE         SERVICE
631/tcp  open          ipp
5353/udp open|filtered zeroconf

Nmap done: 2 IP addresses (1 host up) scanned in 4.43 seconds

I'am quite confused about the role of mdns
for example

nmap -p 5353 ip_of_a_host_you_expect_to_show_up

PORT     STATE  SERVICE
5353/tcp closed mdns

but services are showing up (ssh and vnc) in old laptop

Offline

#20 2023-08-15 13:51:57

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: issues with zeroconf (avahi)

You'll have to provide some explanation of the context of the last paragraph (where did you run that, for what IP and where do services for which . other? - host show up)

;; communications error to 192.168.1.134#53: connection refused

Is obvisouly a problem, I'd start by shutting down whatever firewall you've running there (to establish principle functionality) and then configure that properly.

Offline

#21 2023-08-20 17:13:52

zetet
Member
Registered: 2013-01-21
Posts: 3

Re: issues with zeroconf (avahi)

@lugge I've faced similar issue in my LAN. I've been able to narrow it down to (configuration?) issues in one of mine OpenWRT routers.
mDNS/avahi discovery works without any issues over wired connections, but stops working over wifi. It works when connecting through one router (with proprietary software), fails on OpenWRT one.

If You're connecting over wifi, try cable and see if issues are not gone. If it helps then we can start figuring how to fix multicast over wifi smile

Offline

Board footer

Powered by FluxBB