-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mdns support for nss does not work when networkd is enabled #98050
Comments
possibly related modules:
|
IIRC I experienced issues with @flokli seems to have taken special care in fd21793 to put the nixpkgs/nixos/modules/services/networking/avahi-daemon.nix Lines 241 to 244 in 3d36d46
I couldn't find any mention in upstream's docs to what the arch WiKi says. |
@doronbehar I don't think that commit changed anything - it was merely a code move. As for the general placement,
From my understanding, systemd-resolved should also support mDNS (also see https://wiki.archlinux.org/index.php/Systemd-resolved#mDNS), so having it early might make sense w.r.t caching. I'm not sure if enabling both resolved and |
Yes, the problem is that |
See #99530 for a fix. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-make-systemd-resolved-and-mdns-work-together/10910/2 |
This is still not working for me. I have the following relevant config:
I can
It works however without
I'm on 21.05, so the fix mentioned above should be active? |
I don't have a machine with the same config accessible right now, but I think this behavior might be expected. mDNS resolution with Avahi uses NSS, while Does |
Yes, this is to be expected - avahi goes via nss, and networkd also provides a nss module.
|
Yes. Now I feel stupid. Thank you two for the fast input, I guess that settles it. Only one question left, is there an easy way to make it also work with |
@wucke13 You can use systemd-resolved's mDNS resolver instead of Avahi. Remove all the Avahi related config and add |
For those still searching, this is what worked for me using NetworkManager: # use resolved for hostname resolution
services.resolved.enable = true;
# enable mdns resolution for resolved on all connections
# see https://man.archlinux.org/man/NetworkManager.conf.5#CONNECTION_SECTION
networking.networkmanager.connectionConfig."connection.mdns" = 2;
# still required (at least mdns resolution didn't work for me without)
services.avahi.enable = true;
# nssmdns is NOT needed, since resolved will do the resolution, not the avahi nss module
# services.avahi.nssmdns = true; |
Describe the bug
Remote .local domains cannot be resolved when networkd is enabled
I noticed that
resolve
comes beforemdns_minimal
in the generatednsswitch.conf
:while archwiki recommended putting
mdns_minimal
beforeresolve
: https://wiki.archlinux.org/index.php/Avahi#Hostname_resolutionnot sure if this is the cause
To Reproduce
Steps to reproduce the behavior:
services.avahi.nssmdns
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information:
The text was updated successfully, but these errors were encountered: