configure auth-dns to use netbox-fetched data
This commit is contained in:
parent
eab11d4a5b
commit
d31677b549
2 changed files with 22 additions and 19 deletions
|
@ -1,26 +1,15 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
noc_eh22_internZone = ''
|
zones = (
|
||||||
$ORIGIN noc.eh22.intern.
|
lib.attrsets.mapAttrs' (name: fileType: {
|
||||||
$TTL 3600
|
name = name;
|
||||||
|
value = ../data/zones/${name};
|
||||||
; zone management
|
}) (builtins.readDir ../data/zones)
|
||||||
noc.eh22.intern. IN SOA auth-dns.noc.eh22.intern. noc.eh22.esterhegg.eu. (
|
);
|
||||||
1 ; serial (automatically incremented by knot)
|
|
||||||
7200 ; refresh
|
|
||||||
3600 ; retry
|
|
||||||
3600000 ; expire
|
|
||||||
60 ; negative response caching ttl
|
|
||||||
)
|
|
||||||
@ IN NS auth-dns
|
|
||||||
|
|
||||||
; A/AAAA records
|
|
||||||
proxmox IN A 10.31.210.248
|
|
||||||
auth-dns IN A 10.31.210.253
|
|
||||||
'';
|
|
||||||
|
|
||||||
knotConf = pkgs.writeText "knot.conf" ''
|
knotConf = pkgs.writeText "knot.conf" ''
|
||||||
server:
|
server:
|
||||||
|
@ -48,7 +37,15 @@ in
|
||||||
# enable knot authorative dns server
|
# enable knot authorative dns server
|
||||||
# ref: https://search.nüschtos.de/?query=services.knot
|
# ref: https://search.nüschtos.de/?query=services.knot
|
||||||
# https://www.knot-dns.cz/docs/3.4/html/configuration.html
|
# https://www.knot-dns.cz/docs/3.4/html/configuration.html
|
||||||
environment.etc."knot/zones/noc.eh22.intern.zone".text = noc_eh22_internZone;
|
environment.etc = (
|
||||||
|
lib.attrsets.mapAttrs' (name: value: {
|
||||||
|
name = "knot/zones/noc.eh22.intern.zone";
|
||||||
|
value = {
|
||||||
|
source = value;
|
||||||
|
};
|
||||||
|
}) zones
|
||||||
|
);
|
||||||
|
|
||||||
services.knot = {
|
services.knot = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settingsFile = knotConf;
|
settingsFile = knotConf;
|
||||||
|
|
|
@ -69,6 +69,12 @@
|
||||||
id = 300;
|
id = 300;
|
||||||
subnet = "10.20.25.0/24";
|
subnet = "10.20.25.0/24";
|
||||||
pools = [ { pool = "10.20.25.100 - 10.20.25.254"; } ];
|
pools = [ { pool = "10.20.25.100 - 10.20.25.254"; } ];
|
||||||
|
reservations = [
|
||||||
|
{
|
||||||
|
hw-address = "bc:24:11:c1:8a:a4";
|
||||||
|
ip-address = "10.20.25.3";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue