diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix index 3b8cc0cb8f42..4318dc8528a0 100644 --- a/nixos/modules/config/resolvconf.nix +++ b/nixos/modules/config/resolvconf.nix @@ -27,9 +27,7 @@ let resolv_conf_options='${concatStringsSep " " resolvconfOptions}' '' + optionalString cfg.useLocalResolver '' # This hosts runs a full-blown DNS resolver. - name_servers='127.0.0.1' - '' + optionalString (cfg.useLocalResolver && config.networking.enableIPv6) '' - name_servers='::1' + name_servers='127.0.0.1${optionalString config.networking.enableIPv6 " ::1"}' '' + cfg.extraConfig; in