Skip to content
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

nixos/networking: Add an option whether to use a local DNS resolver #47669

Closed

Conversation

primeos
Copy link
Member

@primeos primeos commented Oct 2, 2018

The autodetection is normally fine but e.g. if one runs BIND as an
authoritative DNS server without caching or forwarding this can be
problematic (the host won't be able to resolve any DNS requests). By
introducing an option for this behaviour it is easily possible to
explicitly enable or disable the use of a local resolver, which will
override the autodetection.

CC: @regellosigkeitsaxiom @wkennington @vcunat (based on the contributions)

I've tested this change and it works, but there are many alternative implementations (didn't have time to think much about it...). I'm open for suggestions if anyone has a better idea :)

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

The autodetection is normally fine but e.g. if one runs BIND as an
authoritative DNS server without caching or forwarding this can be
problematic (the host won't be able to resolve any DNS requests). By
introducing an option for this behaviour it is easily possible to
explicitly enable or disable the use of a local resolver, which will
override the autodetection.
@primeos
Copy link
Member Author

primeos commented Oct 3, 2018

@volth Thanks for the comment, I wasn't aware of that PR :)

I think, a boolean flag would be not flexible anyway (although it is a step forward compared to current buggy "autodetection" which destroys configured static nameservers overriding them with 127.0.0.1).

Yeah, it wasn't flexible at all, it was mainly intended to disable the autodetection. I also probably missed the networking.nameservers option, which is of course way better suited for this. I'll close this PR in favour of yours (unfortunately I can't review it ATM, but I'll keep it in mind, I hope we can merge it soon).

@primeos primeos closed this Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants