Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Can systemd-resolved replace avahi?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Tue May 09, 2023 11:52 am    Post subject: [solved] Can systemd-resolved replace avahi? Reply with quote

Recently, I've noticed the following warning in my logs:
Code:
avahi-daemon[655]: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***

It seems I have both avahi and systemd-resolved running (as mDNS stacks). I recall that avahi used to be the only option for mdns/zeroconf, but apparently systemd-resolved has some support.

Is it possible to replace avahi by systemd-resolved?
It seems some packages need it when setting their zeroconf flag:
Code:
# emerge -c avahi --verbose

Calculating dependencies... done!
  net-dns/avahi-0.8-r7 pulled in by:
    kde-frameworks/kdnssd-5.104.0 requires net-dns/avahi[mdnsresponder-compat]
    media-video/pipewire-0.3.67 requires net-dns/avahi
    media-video/vlc-3.0.18 requires net-dns/avahi[dbus]
    net-fs/samba-4.16.9 requires net-dns/avahi[dbus]
    net-print/cups-2.4.2-r7 requires >=net-dns/avahi-0.6.31-r2[dbus,abi_x86_64(-)]
    net-print/cups-filters-1.28.17 requires net-dns/avahi[dbus]
    sys-auth/nss-mdns-0.15.1 requires >=net-dns/avahi-0.6.31-r2[abi_x86_64(-)]

(Only the last package, nss-mdns does not conditionally depend on avahi; I think I can live without it.)

Now I'm wondering whether systemd-resolved can replace avahi for my use case, which is essentially easier printer discovery when I'm visiting someone else. Is this possible?

If not, I guess I should disable systemd-resolved's mdns stack?


Last edited by equaeghe on Tue May 09, 2023 7:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 297

PostPosted: Tue May 09, 2023 4:41 pm    Post subject: Reply with quote

You can do your own research and decide what is best for you, but IMO you should just use avahi for mDNS. If you are using Network Manager, you ideally need to create /etc/NetworkManager/conf.d/NetworkManager.conf with:
Code:
connection.llmnr=0

As well, /etc/systemd/resolved.conf with:
Code:

MulticastDNS=no
LLMNR=no

You can do your own research and decide whether or not to disable LLMNR is best for you, but I would recommend it.
https://brokkr.net/2022/07/03/switching-to-systemd-resolved-for-mdns/
https://wiki.archlinux.org/title/Systemd-resolved (section 2.2 mDNS, section 2.3 LLMNR)
https://wiki.archlinux.org/title/avahi#systemd-resolved_prevents_nss-mdns_from_working

On a side note: If you ever have any issues with DNSSEC, you can disable it in /etc/systemd/resolved.conf with:
DNSSEC=no
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Tue May 09, 2023 6:30 pm    Post subject: Reply with quote

Quote:
Is it possible to replace avahi by systemd-resolved?
Avahi does much more than just mdns, so probably no.
Quote:
If not, I guess I should disable systemd-resolved's mdns stack?
Systemd-resolved can't even do it's own job (caching dns responses) properly, so I'd suggest you disable and mask it. And install dnsmasq if you do want to have a dns cache on your machine. If, because you can live without it, and in many cases either won't see a difference or have a better alternative, like a site-local cache for all machines on your network. E.g. SOHO routers often come with DNS relay by default.
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Tue May 09, 2023 7:35 pm    Post subject: Reply with quote

rab0171610 wrote:
You can do your own research and decide what is best for you, but IMO you should just use avahi for mDNS. […]
Thanks for the input! I decided to follow your advice.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum