Using systemd-resolved to handle dot local addresses

Kernels & Hardware, configuring network, installing services

Using systemd-resolved to handle dot local addresses

Postby mikedeplume » 2019-09-29 16:17

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?
mikedeplume
 
Posts: 9
Joined: 2019-09-21 08:26

Re: Using systemd-resolved to handle dot local addresses

Postby Head_on_a_Stick » 2019-09-29 18:06

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.
User avatar
Head_on_a_Stick
 
Posts: 11587
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Using systemd-resolved to handle dot local addresses

Postby mikedeplume » 2019-09-30 08:11

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.
mikedeplume
 
Posts: 9
Joined: 2019-09-21 08:26

Re: Using systemd-resolved to handle dot local addresses

Postby Head_on_a_Stick » 2019-09-30 14:27

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.
User avatar
Head_on_a_Stick
 
Posts: 11587
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Using systemd-resolved to handle dot local addresses

Postby mikedeplume » 2019-10-01 18:52

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.
mikedeplume
 
Posts: 9
Joined: 2019-09-21 08:26

Re: Using systemd-resolved to handle dot local addresses

Postby Head_on_a_Stick » 2019-10-02 15:36

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 ... t_(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.
User avatar
Head_on_a_Stick
 
Posts: 11587
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to System configuration

Who is online

Users browsing this forum: No registered users and 20 guests

fashionable