Explicitly set notify IPs seperate from nameservers.

This commit is contained in:
niten 2023-11-09 09:15:44 -08:00
parent 65ba1e165d
commit 9b3742b480
2 changed files with 12 additions and 6 deletions

View File

@ -38,6 +38,12 @@ let
"List of subnets for which to generate reverse lookup zones."; "List of subnets for which to generate reverse lookup zones.";
default = [ ]; default = [ ];
}; };
notify-ips = mkOption {
type = listOf str;
description = "List of IP addresses to notify of changes.";
default = [ ];
};
}; };
}; };
@ -96,8 +102,8 @@ in {
nameValuePair "${domain}." { nameValuePair "${domain}." {
dnssec = ksk.key-file != null; dnssec = ksk.key-file != null;
ksk.keyFile = ksk.key-file; ksk.keyFile = ksk.key-file;
provideXFR = map (ns: "${ns}/32 NOKEY") zone.nameservers; provideXFR = map (ns: "${ns}/32 NOKEY") zone.notify-ips;
notify = map (ns: "${ns} NOKEY") zone.nameservers; notify = map (ns: "${ns} NOKEY") zone.notify-ips;
data = zoneToZonefile { data = zoneToZonefile {
inherit domain; inherit domain;
inherit (cfg) timestamp; inherit (cfg) timestamp;
@ -109,7 +115,7 @@ in {
listToAttrs (map (network: listToAttrs (map (network:
reverseZonefile { reverseZonefile {
inherit domain network; inherit domain network;
inherit (zone) nameservers; inherit (zone) nameservers notify-ips;
keyFile = ksk.key-file; keyFile = ksk.key-file;
ipHostMap = cfg.ip-host-map; ipHostMap = cfg.ip-host-map;
serial = cfg.timestamp; serial = cfg.timestamp;

View File

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ domain, network, nameservers, ipHostMap, serial, keyFile ? null { domain, network, nameservers, notify-ips, ipHostMap, serial, keyFile ? null
, zoneTTL ? 10800, refresh ? 3600, retry ? 1800, expire ? 604800, minimum ? 3600 , zoneTTL ? 10800, refresh ? 3600, retry ? 1800, expire ? 604800, minimum ? 3600
}: }:
@ -54,8 +54,8 @@ let
in nameValuePair "${getNetworkZoneName network}" { in nameValuePair "${getNetworkZoneName network}" {
dnssec = keyFile != null; dnssec = keyFile != null;
ksk.keyFile = keyFile; ksk.keyFile = keyFile;
provideXFR = map (ns: "${ns}/32 NOKEY") nameservers; provideXFR = map (ns: "${ns}/32 NOKEY") notify-ips;
notify = map (ns: "${ns} NOKEY") nameservers; notify = map (ns: "${ns} NOKEY") notify-ips;
data = '' data = ''
$ORIGIN ${getNetworkZoneName network} $ORIGIN ${getNetworkZoneName network}
$TTL ${toString zoneTTL} $TTL ${toString zoneTTL}