You are not logged in.

#1 2019-03-08 15:05:21

carbolymer
Member
Registered: 2012-04-25
Posts: 32

NetworkManager: mDNS not being enabled by default

After system boot, NetworkManager is not enabling mdns for any connection (eth0 is connected):

$ resolvectl mdns                                                 
Global: yes
Link 7 (br-d29235c7c508): no
Link 6 (docker0): no
Link 5 (vmnet8): no
Link 4 (vmnet1): no
Link 3 (wlan0): no
Link 2 (eth0): no

To enable mdns I need to restart NetworkManager, disconnect manually eth0 and connect to it again. Then mdns is enabled:

15:43:59 [root:/etc/NetworkManager] # resolvectl mdns
Global: yes
Link 7 (br-d29235c7c508): no
Link 6 (docker0): no
Link 5 (vmnet8): no
Link 4 (vmnet1): no
Link 3 (wlan0): no
Link 2 (eth0): resolve

mdns is enabled in configuration:

15:44:29 [root:/etc/NetworkManager] # grep -R -i mdns *
conf.d/mdns.conf:connection.mdns=1
15:46:28 [root:/etc/NetworkManager] # cat conf.d/mdns.conf
[connection]
connection.mdns=1

15:46:36 [root:/etc/NetworkManager] # grep -R -i mdns /var/run/NetworkManager 
15:46:44 [root:/etc/NetworkManager] 1 # cat NetworkManager.conf 
[main]
plugins=keyfile
dns=systemd-resolved

## HTTP-based connectivity check
#[connectivity]
#uri=http://nmcheck.gnome.org/check_network_status.txt
#interval=100
15:50:05 [root:/etc/systemd] # cat resolved.conf 
#  This file is part of systemd.
#
#  systemd 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.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]
#DNS=
#FallbackDNS=1.1.1.1 9.9.9.10 8.8.8.8 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888
#Domains=
#LLMNR=yes
MulticastDNS=yes
#DNSSEC=allow-downgrade
#DNSOverTLS=no
#Cache=yes
#DNSStubListener=yes
#ReadEtcHosts=yes

I've configured mDNS accordingly to the https://wiki.archlinux.org/index.php/Sy … olved#mDNS . I have also avahi installed but disabled, I've also removed mdns entries from nsswitch.conf

I'm not sure what is wrong. Any ideas if this is incorrect configuration or a bug?

Offline

#2 2019-03-09 14:01:35

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,060

Re: NetworkManager: mDNS not being enabled by default

mDNS will only be activated for the connection if both the systemd-resolved's global setting (MulticastDNS= in resolved.conf(5)) and the network manager's per-connection setting is enabled.

What is the content of resolved.conf ?

Last edited by Lone_Wolf (2019-03-09 14:01:52)


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2019-03-15 09:00:06

carbolymer
Member
Registered: 2012-04-25
Posts: 32

Re: NetworkManager: mDNS not being enabled by default

That might be a bit unreadable, but it's already posted in the first post.

15:50:05 [root:/etc/systemd] # cat resolved.conf 
#  This file is part of systemd.
#
#  systemd 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.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]
#DNS=
#FallbackDNS=1.1.1.1 9.9.9.10 8.8.8.8 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888
#Domains=
#LLMNR=yes
MulticastDNS=yes
#DNSSEC=allow-downgrade
#DNSOverTLS=no
#Cache=yes
#DNSStubListener=yes
#ReadEtcHosts=yes

Offline

#4 2019-07-11 21:38:44

lenhuppe
Member
From: New Hampshire
Registered: 2018-12-10
Posts: 57

Re: NetworkManager: mDNS not being enabled by default

Lone_Wolf wrote:

mDNS will only be activated for the connection if both the systemd-resolved's global setting (MulticastDNS= in resolved.conf(5)) and the network manager's per-connection setting is enabled.

What is the content of resolved.conf ?

If by "resolved.conf" you mean "/etc/systemd/resolved.conf" then you are looking in the wrong place. The line with "#MulticastDNS=yes" is telling you what the default setting is for systemd-resolved. I know this from troubleshooting mDNS issues with systemd in the past. My experience is that systemd-resolved does mDNS right out of the box with no configuration. You do however have to enable mDNS to work with systemd-networkd.

I recently switched from systemd-networkd to NetworkManager and I am having almost the same issue as OP. I can use mdns-scan to see some of my devices but none of my desktops running NetworkManager are responding. To my knowledge everything else is functional as far networking goes. 

Here is my setup:

I am using NetworkManager, unbound and nss-mdns.

/etc/nsswitch.conf

# 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 resolve [!UNAVAIL=return] dns
networks: files

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

netgroup: files

/etc/NetworkManager/conf.d/local.conf

[main]
dns=none
plugins=keyfile
rc-manager=resolvconf
[connection]
connection.mdns=2

/etc/resolvconf.conf

# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details
resolv_conf=/etc/resolv.conf
name_servers=127.0.0.1
unbound_conf=/etc/unbound/resolvconf.conf

Last edited by lenhuppe (2019-07-13 23:30:34)

Offline

Board footer

Powered by FluxBB