Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Using systemd-resolved to handle dot local addresses

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
mikedeplume
Posts: 9
Joined: 2019-09-21 08:26

Using systemd-resolved to handle dot local addresses

#1 Post by mikedeplume »

I am trying to get systemd-resolved to use mDNS to resolve .local addresses. Using

Code: Select all

resolvectl query server.local
fails with "No appropriate name servers or networks found". This is not what I want.

I have installed Debian 10.1 on a laptop and I am trying to use .local to access shared facilities on my network. Initially I installed avahi for this but I found that sometimes a local address would be resolved, and sometimes it would not. Looking around I found that systemd-resolved now supports mDNS and there was a suggestion that systemd and avahi might conflict. This is my first go at Debian 10, all my other systems are Debian 9, and it looks as though this mDNS feature is new in 10. I have not had this problem under 9. Since I don't need to advertise services from my laptop I decided to try the systemd-resolved feature.

This requires these steps:

1. Disable the avahi daemon. I did that and actually uninstalled the daemon.

2. Make sure that resolved.conf enables mDNS. Interestingly, this comes as default, which it didn't under 9.

3. Make sure /etc/resolv.conf is a symlink to one of a number of possible locations. I have it in /etc/resolvconf/run/resolv.conf

4. Make sure that mDNS is enabled in for each relevant connection.

It's this last one that seems to cause the problem. I have installed NetworkManager and configured it so that all connections should have mdns=2 by default.

I have a number of issues here:

* I expect mdns=2 to enlist support for both resolution of names and response to mDNS requests from other systems. The documentation is not clear and I got this vale from ArchWiki.

* The man page for nm-settings tells me that I need to install a NetworkManager plugin that supports mDNS, saying "One such plugin is dns-systemd-resolved". I have tried adding a plugin to NetworkManager, with various spellings, and none are recognised. I have no idea how to find NetwokManager plugins other than using the Debian package index and this only gives me a number of VPN related entries. The ArchWiki entry makes no mention of plugins.

* After making all the changes I can I run

Code: Select all

resolvectl mdns
to find connections that support mDNS, and it turns out that none of them do.

Can anyone confirm the mdns=2 setting?

Can anyone help find a NetworkManager plugin such as dns-systemd-resolved?

Has anyone actually got this working?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Using systemd-resolved to handle dot local addresses

#2 Post by Head_on_a_Stick »

mikedeplume wrote:Has anyone actually got this working?
Yes:

Code: Select all

E485:~# resolvectl mdns iwl0 --no-p
Link 3 (iwl0): yes
E485:~#
I'm using systemd-networkd with MulticastDNS=true set in the .network file.

You could try

Code: Select all

# resolvectl mdns $interface on
Replace $interface with the actual interface name, obviously.

Disclaimer: I don't actually use mDNS.
deadbang

mikedeplume
Posts: 9
Joined: 2019-09-21 08:26

Re: Using systemd-resolved to handle dot local addresses

#3 Post by mikedeplume »

Thanks.
Head_on_a_Stick wrote:I'm using systemd-networkd with MulticastDNS=true set in the .network file.
I think what you are saying is that NetworkManager is the problem. I had been thinking I might be better off using systemd-networkd but have been rather put off by the apparent complexity. Since I have spent far too long trying to get NetworkManager going I should perhaps just cut my losses and bite the bullet :-)

I'm happy to stick with NetworkManager if it's going to work, but in the meantime I'll read up about the systemd stuff.

Thanks for the prompt.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Using systemd-resolved to handle dot local addresses

#4 Post by Head_on_a_Stick »

mikedeplume wrote:I think what you are saying is that NetworkManager is the problem.
Well I have no idea if NM can do this, I don't use that program.

It's pretty simple to setup systemd-networkd, the man pages are very good and the ArchWiki has a useful page on it.
deadbang

mikedeplume
Posts: 9
Joined: 2019-09-21 08:26

Re: Using systemd-resolved to handle dot local addresses

#5 Post by mikedeplume »

Head_on_a_Stick wrote:and the ArchWiki has a useful page on it.
Well, indeed :-)

I have given up on NetworkManager. I installed systemd-networkd without too much trouble, as you thought. It's a laptop, though, so I need to manage wifi :-(

I started out with wpa_supplicant, it seems common and generally well understood. Except this is debian 10, not 9. It turns out that the deamon is now started with -u, which tells it to use d-bus. and another switch (-O) that points to a communication path for new interfaces. Neither of which have especially good documentation, so I spent a weary hour or two working out how to connect wpa_cli/_gui and generally got nowhere.

Enter iwd - and all is working. I don't have a systray entry for managing new networks, but otherwise I'm happy.

Thanks for your support, and for coming along on the ride.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Using systemd-resolved to handle dot local addresses

#6 Post by Head_on_a_Stick »

mikedeplume wrote:I started out with wpa_supplicant, it seems common and generally well understood. Except this is debian 10, not 9. It turns out that the deamon is now started with -u, which tells it to use d-bus. and another switch (-O) that points to a communication path for new interfaces. Neither of which have especially good documentation, so I spent a weary hour or two working out how to connect wpa_cli/_gui and generally got nowhere.
See https://wiki.archlinux.org/index.php/WP ... _(systemd) & https://wiki.archlinux.org/index.php/WP ... figuration
mikedeplume wrote:Enter iwd - and all is working
Nice, iwd is better than wpa_supplicant anyway.
deadbang

Post Reply