From 56373744b4d87dce28feb2c05ea2532631b4c44a Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 2 Jul 2012 15:01:02 +0200 Subject: [PATCH] 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'. --- modules/config/networking.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/config/networking.nix b/modules/config/networking.nix index 5065fc22f2ce..2b4be69cc51f 100644 --- a/modules/config/networking.nix +++ b/modules/config/networking.nix @@ -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"; }