Files
nix-config/modules/nixos/base/networking/avahi.nix
T
Ryan Yin 2dff4f062b fix(networking): disable systemd-resolved mDNS when avahi is enabled
networkd enables systemd-resolved by default, and resolved's own mDNS responder conflicts with avahi (duplicate answers, avahi logs 'Detected another mDNS stack running on this host'). Keep avahi for DNS-SD (cups-browsed depends on it) and turn resolved's mDNS off.
2026-09-19 13:54:19 +08:00

22 lines
672 B
Nix

{
# Network discovery on a local network, mDNS
# With this enabled, you can access your machine at <hostname>.local
# it's more convenient than using the IP address.
# https://avahi.org/
services.avahi = {
enable = true;
nssmdns4 = true;
publish = {
enable = true;
domain = true;
userServices = true;
};
};
# avahi and systemd-resolved both run an mDNS responder, which makes mDNS
# unreliable ("Detected another IPv4/IPv6 mDNS stack running on this host").
# Keep avahi (needed for DNS-SD, e.g. CUPS printer discovery) and turn off
# resolved's own mDNS.
services.resolved.settings.Resolve.MulticastDNS = false;
}