You are not logged in.

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

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

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: 11,911

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)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

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

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

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 USA
Registered: 2018-12-10
Posts: 272
Website

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 ?

I recently tried switching from systemd-networkd to NetworkManager and had almost the same issue as OP. If I ever figure it out I will post my findings.

Last edited by lenhuppe (2019-08-05 17:46:08)


Why do we drive on the parkway and then park in the driveway?

Offline

#5 2021-03-30 21:40:15

imrehg
Member
From: London, UK
Registered: 2008-04-10
Posts: 108
Website

Re: NetworkManager: mDNS not being enabled by default

Hey, I was having similar issues, and seems like for the systemd-resolved + NetworkManager combo what works for me is:

# /etc/systemd/resolved.conf
[Resolve]
...
MulticastDNS=yes
...

and

/etc/NetworkManager/NetworkManager.conf
...
[connection]
connection.mdns=2

where the "..." is just ignoring other values. The "connection.mdns=1" would just set "mDNS=resolve" mode, it was just a hunch that I tried the value 2 to enable the full mode (the man entry doesn't mention it, and generally not helpful). With these settings I get the right defaults, e.g. after reboot or after "systemctl restart systemd-resolved NetworkManager", like this (other stuff were set as well, just meaning the "+mDNS" values):

/etc/systemd> resolvectl status                         
Global
           Protocols: +LLMNR +mDNS DNSOverTLS=opportunistic DNSSEC=yes/supported                    
    resolv.conf mode: stub                                                                          
Fallback DNS Servers: 1.1.1.1 9.9.9.10 8.8.8.8 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888

Link 2 (wlan0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6 mDNS/IPv4 mDNS/IPv6                           
         Protocols: +DefaultRoute +LLMNR +mDNS DNSOverTLS=opportunistic DNSSEC=yes/supported
Current DNS Server: 8.8.4.4                                                                 
       DNS Servers: 8.8.8.8 8.8.4.4                                                         
        DNS Domain: lan 

Offline

Board footer

Powered by FluxBB