Skip to content

Commit 23a021d

Browse files
committedSep 23, 2017
Revert "nixos: add option for bind to not resolve local queries (#29503)"
This reverts commit 670b4e2. The change added in this commit was controversial when it was originally suggested in #29205. Then that PR was closed and a new one opened, #29503, effectively circumventing the review process. I don't agree with this modification. Adding an option 'resolveLocalQueries' to tell the locally running name server that it should resolve local DNS queries feels outright nuts. I agree that the current state is unsatisfactory and that it should be improved, but this is not the right way.
1 parent f7411b8 commit 23a021d

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed
 

‎nixos/modules/config/networking.nix

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ let
99
cfg = config.networking;
1010
dnsmasqResolve = config.services.dnsmasq.enable &&
1111
config.services.dnsmasq.resolveLocalQueries;
12-
bindResolve = config.services.bind.enable &&
13-
config.services.bind.resolveLocalQueries;
14-
hasLocalResolver = bindResolve || dnsmasqResolve;
12+
hasLocalResolver = config.services.bind.enable || dnsmasqResolve;
1513

1614
resolvconfOptions = cfg.resolvconfOptions
1715
++ optional cfg.dnsSingleRequest "single-request"

‎nixos/modules/services/networking/bind.nix

-9
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,6 @@ in
151151
";
152152
};
153153

154-
resolveLocalQueries = mkOption {
155-
type = types.bool;
156-
default = true;
157-
description = ''
158-
Whether bind should resolve local queries (i.e. add 127.0.0.1 to
159-
/etc/resolv.conf, overriding networking.nameserver).
160-
'';
161-
};
162-
163154
};
164155

165156
};

‎nixos/modules/services/networking/dnsmasq.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ in
4242
default = true;
4343
description = ''
4444
Whether dnsmasq should resolve local queries (i.e. add 127.0.0.1 to
45-
/etc/resolv.conf overriding networking.nameservers).
45+
/etc/resolv.conf).
4646
'';
4747
};
4848

‎nixos/modules/tasks/network-interfaces-scripted.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ let
105105
''
106106
# Set the static DNS configuration, if given.
107107
${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
108-
${optionalString (cfg.domain != null) ''
108+
${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
109109
domain ${cfg.domain}
110110
''}
111111
${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}

0 commit comments

Comments
 (0)