mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 12:42:24 +00:00
unbound service: convenient handling of local forward addresses
do-not-query-localhost defaults to yes; with this patch, unbound is configured to query localhost if any of the forward addresses are local.
This commit is contained in:
parent
fa787da36f
commit
7980523e00
|
@ -12,9 +12,17 @@ let
|
|||
|
||||
interfaces = concatMapStrings (x: " interface: ${x}\n") cfg.interfaces;
|
||||
|
||||
forward = optionalString (length cfg.forwardAddresses != 0)
|
||||
"forward-zone:\n name: .\n" +
|
||||
concatMapStrings (x: " forward-addr: ${x}\n") cfg.forwardAddresses;
|
||||
isLocalAddress = x: substring 0 9 x == "127.0.0.1";
|
||||
|
||||
forward =
|
||||
optionalString (any isLocalAddress cfg.forwardAddresses) ''
|
||||
do-not-query-localhost: no
|
||||
'' +
|
||||
optionalString (cfg.forwardAddresses != []) ''
|
||||
forward-zone:
|
||||
name: .
|
||||
'' +
|
||||
concatMapStringsSep "\n" (x: " forward-addr: ${x}") cfg.forwardAddresses;
|
||||
|
||||
rootTrustAnchorFile = "${stateDir}/root.key";
|
||||
|
||||
|
|
Loading…
Reference in a new issue