DNS and avahi-daemon

I have DHCP and DNS (named) running on my server.
I have 3 network devices: one enslaved in a bridge (used for VM), one used for 4 vlan and the last used for external connection via pppd.
All managed by systemd-networkd, systemd-resolved.

hpprol2:~ # networkctl list 
IDX LINK   TYPE     OPERATIONAL SETUP      
  1 lo     loopback carrier     unmanaged
  2 eno1   ether    enslaved    configured 
  3 eno2   ether    carrier     configured 
  4 eno3   ether    carrier     configured 
  5 eno4   ether    off         unmanaged
  6 br0    bridge   routable    configuring
  7 vlan4  vlan     routable    configured 
  8 vlan1  vlan     routable    configured 
  9 vlan2  vlan     routable    configured 
 10 vlan3  vlan     routable    configured 
 11 ppp0   ppp      routable    unmanaged
 12 virbr0 bridge   no-carrier  unmanaged
12 links listed.
hpprol2:~ # 

I have also avahi-daemon running: I think it was automatically set during installation in 2021.
In journalctl I have this warning about avahi-daemon

Mar 24 08:06:02 hpprol2 avahi-daemon[1052]: No service file found in /etc/avahi/services.
Mar 24 08:06:02 hpprol2 avahi-daemon[1052]: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***
Mar 24 08:06:02 hpprol2 avahi-daemon[1052]: *** WARNING: Detected another IPv6 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***
Mar 24 08:06:02 hpprol2 avahi-daemon[1052]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.

Questions:
Is avahi-daemon needed by anything?
Can I stop and disable it?

Many thanks in advance
Philippe

On host erlangen avahi is configured properly:

erlangen:~ # systemctl list-unit-files avahi*
UNIT FILE              STATE   PRESET  
avahi-daemon.service   enabled enabled 
avahi-dnsconfd.service enabled disabled
avahi-daemon.socket    enabled disabled

3 unit files listed.
erlangen:~ # 

The above settings ensure a smooth operation of NetworkManager using DHCP / DNS even when frequently booting my desktop machines into other operating systems. No errors encountered since making the switch in December 2022. No errors logged to journal:

erlangen:~ # journalctl -b -g avahi
Mar 23 17:44:59 erlangen systemd[1]: Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
Mar 23 17:44:59 erlangen systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Mar 23 17:44:59 erlangen systemd[1]: Started Avahi DNS Configuration Daemon.
Mar 23 17:44:59 erlangen avahi-daemon[943]: Found user 'avahi' (UID 498) and group 'avahi' (GID 497).
Mar 23 17:44:59 erlangen avahi-daemon[943]: avahi-daemon 0.8 starting up.
Mar 23 17:44:59 erlangen systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Mar 23 17:44:59 erlangen avahi-daemon[943]: Loading service file /etc/avahi/services/sftp-ssh.service.
Mar 23 17:44:59 erlangen avahi-daemon[943]: Loading service file /etc/avahi/services/ssh.service.
Mar 23 17:44:59 erlangen avahi-dnsconfd[944]: Successfully connected to Avahi daemon.
Mar 23 17:45:01 erlangen avahi-daemon[943]: Service "erlangen" (/etc/avahi/services/ssh.service) successfully established.
Mar 23 17:45:01 erlangen avahi-daemon[943]: Service "erlangen" (/etc/avahi/services/sftp-ssh.service) successfully established.
erlangen:~ # 

So, the solution for any problem of every user is to use host erlangen?

How is smooth operation of NetworkManager on host erlangen is relevant to the OP question about systemd-networkd and systemd-resolved on own system?

Avahi may be used by other programs to query/announce information of mDNS. I guess the best way is to stop avahi and look for any fallout :slight_smile: In the worst case some program will fail to find something on network.

Thanks,
I have set the avahi-daemon as “manually start”.
As far as I see installed programs requiring it, are mostly for printer and scanner backends.
My printers are using lpd and don’t use avahi-daemon.
My USB scanner seems using it , if avahi-daemon is not runing it is started automatically by the scanner program ( via avahi-daemon.socket I think)

hpprol2:~ # systemctl stop avahi-daemon
Warning: Stopping avahi-daemon.service, but it can still be activated by:
avahi-daemon.socket

So this seems good for me.
Regards
Philippe