You are not logged in.

#1 2018-01-21 06:58:19

evetsso
Member
Registered: 2018-01-21
Posts: 5

resolving *.local names doesn't work when avahi started via systemd

I can't seem to get .local names to resolve properly through nss-mdns, when avahi is started through systemd.
systemd + libsystemd are 236.81, avahi is 0.7-2, nss-mdns is 0.10-6.

/etc/nsswitch.conf has:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

avahi-daemon is running under systemd:

> systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-01-20 23:35:29 MST; 1min 40s ago
 Main PID: 10335 (avahi-daemon)
   Status: "avahi-daemon 0.7 starting up."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/avahi-daemon.service
           ├─10335 avahi-daemon: running [skeith.local]
           └─10336 avahi-daemon: chroot helper

And yet:

> ping skeith.local
ping: skeith.local: Name or service not known

Even though avahi-resolve works:

> avahi-resolve -n skeith.local -4
skeith.local    192.168.2.200

But if I stop avahi-daemon, and run it manually as root:

# avahi-daemon --debug 
Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Successfully dropped root privileges.
avahi-daemon 0.7 starting up.
chroot.c: chroot() helper started
Successfully called chroot().
Successfully dropped remaining capabilities.
chroot.c: chroot() helper got command 02
Failed to read /etc/avahi/services.
Joining mDNS multicast group on interface enp3s0.IPv6 with address fd00:a84e:3f50:4cb2:3653:b873:f0d6:33fc.
New relevant interface enp3s0.IPv6 for mDNS.
Joining mDNS multicast group on interface enp3s0.IPv4 with address 192.168.2.200.
New relevant interface enp3s0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for fd00:a84e:3f50:4cb2:3653:b873:f0d6:33fc on enp3s0.*.
Registering new address record for 192.168.2.200 on enp3s0.IPv4.
Server startup complete. Host name is skeith.local. Local service cookie is 502440686.

Then name resolution starts working:

> ping skeith.local
PING skeith.local (192.168.2.200) 56(84) bytes of data.
...etc

I've been able to repro this on a fresh install, so I don't think it's related to anything I've done on this computer.

Couple of things I noticed in trying to diagnose this.  One is that strace shows a major difference between the good and bad results.
avahi without systemd:

connect(5, {sa_family=AF_UNIX, sun_path="/var/run/avahi-daemon/socket"}, 110) = 0

avahi under systemd:

connect(5, {sa_family=AF_UNIX, sun_path="/var/run/avahi-daemon/socket"}, 110) = -1 ECONNREFUSED (Connection refused)

Another is that lsof shows different results between the two as well:
avahi without systemd:

# lsof /run/avahi-daemon/socket 
COMMAND     PID  USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
systemd       1  root   59u  unix 0xffff959018a0f000      0t0    544 /run/avahi-daemon/socket type=STREAM
avahi-dae 10357 avahi    8u  unix 0xffff958f26341400      0t0 199995 /run/avahi-daemon/socket type=STREAM

avahi under systemd:

# lsof /run/avahi-daemon/socket 
COMMAND     PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
systemd       1  root   59u  unix 0xffff959018a0f000      0t0  544 /run/avahi-daemon/socket type=STREAM
avahi-dae 10393 avahi    3u  unix 0xffff959018a0f000      0t0  544 /run/avahi-daemon/socket type=STREAM
avahi-dae 10394 avahi    3u  unix 0xffff959018a0f000      0t0  544 /run/avahi-daemon/socket type=STREAM

The second avahi-daemon process is the chroot helper.

I have no local customizations to any of the avahi unit files.

Could this be a bug in systemd?  Not sure exactly when this broke but I'm pretty sure I've observed this working on Arch for years.

Thanks in advance for any assistance!

Offline

#2 2018-01-24 05:11:15

evetsso
Member
Registered: 2018-01-21
Posts: 5

Re: resolving *.local names doesn't work when avahi started via systemd

Hmm.. somehow this started working again, no idea what happened.

Offline

#3 2018-05-20 15:36:40

aviallon
Member
Registered: 2016-09-14
Posts: 1

Re: resolving *.local names doesn't work when avahi started via systemd

I've got the same problem here... except that it doesn't work even when started manually...

Offline

#4 2018-09-29 17:32:36

serzh-z
Member
From: Russia
Registered: 2012-11-13
Posts: 12

Re: resolving *.local names doesn't work when avahi started via systemd

evetsso, aviallon, did you solve the issue? For me it looks like the issue is still here (avahi 0.7, nss-mdns 0.14.1 and systemd 239.1) and nss-mdns does not work at all.

Last edited by serzh-z (2018-09-29 17:33:19)


I woke up in my bed today - a hundred years ago. Who am I? Who am I...

Offline

#5 2018-09-30 07:35:30

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 595

Re: resolving *.local names doesn't work when avahi started via systemd

The issue is most likely a broken DNS server. See the note in https://github.com/lathiat/nss-mdns/blo … activation and FS#59748.

Offline

Board footer

Powered by FluxBB