Set resolveconf to localhost only when the user does not specify any …#122843
Set resolveconf to localhost only when the user does not specify any …#122843gwitmond wants to merge 3 commits intoNixOS:masterfrom
Conversation
…nameservers. The problem was that when the user defines networking.nameservers and then enables services.bind the user's nameservers are ignored. This violates the principle of least surprise. This change sets the default only when the user does not specify any nameservers.
|
Ignore this one, it's better solved at resolvconf.nix. I'll make an update. |
Bug: when the user specifies `networking.nameserver` and enables services `bind` `unbound` or `dnsmasq`, the resolver would assume these are client resolvers and set resolvconf to 127.0.0.1. This ignores the user specified name servers and violates the principle of least surprise. This change tests for explicit specified name servers before applying the default.
|
I think, this is the correct solution. Please review. |
|
I'm not sure. In case of |
|
In other words, assuming we keep this automagic, in cases like yours I'd expect the configuration explicitly sets Your approach would make sense perhaps if we additionally made the option internal, or some such "larger" change of what's being done here. |
|
The problem I'm trying to solve is this one. I have static configured networking, so I've set I also run a Bind named service as master for a few domains. As that thing manages the private keys for DNSSEC, I don't want it to do client resolving. However, without my proposed patch, enabling Bind will override my explicit defined name server configuration and set 127.0.0.1. That's what I mean with principle of least surprise: an explicit configuration should not be ignored by a default setting. As there is no documentation in either I hope this clears things up. |
|
Aah, I didn't realize there's this common issue due to |
|
I can add some documentation at bind, unbound and dnsmasq to tell about the |
|
I guess, this could be added to options.services.{bind,unbound,dnsmasq}.enable.description: Please let me know if you think that would be helpful to the user. Personally, I think my patch does exactly that, let the default be 127.0.0.1 unless the user specifies nameservers themselves. Cheers. |
|
I marked this as stale due to inactivity. → More info |
…nameservers.
The problem was that when the user defines
networking.nameserversand then enablesservices.bindthe user's name servers are ignored. This violates the principle of least surprise.
This change sets the default only when the user does not specify any name servers.
Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)