modules/config/networking.nix: recognize whether a local DNS resolver is available
resolvconf prefers a locally running BIND resolver over the forwarders; we just have to tell it whether we have one or not. We use 'config.services.bind.enable' to make that decision, assuming that people are not going to configure a local BIND that won't respond to queries on 127.0.0.1. If we run into such a (weird) case, then we'll need to introduce another variable for that purpose which can be set independently from 'config.services.bind.enable'.
This commit is contained in:
parent
f22dbd5e05
commit
56373744b4
|
@ -68,6 +68,9 @@ in
|
|||
# Invalidate the nscd cache whenever resolv.conf is
|
||||
# regenerated.
|
||||
libc_restart='${pkgs.upstart}/sbin/start invalidate-nscd'
|
||||
'' + optionalString config.services.bind.enable ''
|
||||
# This hosts runs a full-blown DNS resolver.
|
||||
name_servers='127.0.0.1'
|
||||
'' );
|
||||
target = "resolvconf.conf";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue