summaryrefslogtreecommitdiff
path: root/config/dns.nix
diff options
context:
space:
mode:
Diffstat (limited to 'config/dns.nix')
-rw-r--r--config/dns.nix20
1 files changed, 18 insertions, 2 deletions
diff --git a/config/dns.nix b/config/dns.nix
index 32d54a5..b0e52f6 100644
--- a/config/dns.nix
+++ b/config/dns.nix
@@ -2,7 +2,7 @@
# dnssec-keygen -K /secret/keys/example.net example.net
{ config, lib, pkgs, ... }:
let
- masterZones = [ "orbekk.com" "orbekk.no" "kufieta.net" ];
+ masterZones = [ "tommvo.com" "orbekk.com" "orbekk.no" "kufieta.net" ];
zone-files = pkgs.callPackage ../pkgs/zone-files/default.nix { };
in
{
@@ -13,6 +13,11 @@ in
services.bind = {
enable = true;
+ cacheNetworks = [
+ "::1/128"
+ "127.0.0.0/24"
+ "10.0.0.0/8"
+ ];
extraOptions = ''
serial-update-method unixtime;
'';
@@ -39,6 +44,7 @@ in
2a00:1b60:1011::6def:e868; // ns1
2001:67c:29f4::61; // ns2
};
+ notify-source-v6 2001:470:8e2e:20::d;
notify explicit;
};
'') masterZones}
@@ -62,6 +68,7 @@ in
2a00:1b60:1011::6def:e868; // ns1
2001:67c:29f4::61; // ns2
};
+ notify-source-v6 2001:470:8e2e:20::d;
notify explicit;
update-policy {
grant dynamic.orbekk.com.key zonesub any;
@@ -74,7 +81,16 @@ in
preStart = lib.mkAfter ''
#rm /var/run/named/*.jnl || true
#rm /var/run/named/*.jbk || true
- cp -f ${zone-files}/* /var/run/named/
+ echo "Copy zone files"
+ for z in ${zone-files}/*; do
+ if [[ $z =~ .*dynamic.* && -e "/var/run/named/$(basename $z)" ]]; then
+ echo "Skip dynamic zone $z"
+ continue
+ fi
+ echo "Copy zone $z"
+ cp -f $z /var/run/named/
+ done
+ echo "Done copying zone files"
'';
};
}