mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-24 23:56:20 +02:00
falkenstein: enable dnssec
This commit is contained in:
parent
be70c4119a
commit
9f0712d2ca
1 changed files with 60 additions and 50 deletions
|
@ -1,21 +1,10 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.bind = {
|
||||
enable = true;
|
||||
zones = {
|
||||
"rfive.de" = {
|
||||
master = true;
|
||||
slaves = [
|
||||
"185.181.104.96"
|
||||
];
|
||||
extraConfig = ''
|
||||
also-notify {185.181.104.96;};
|
||||
'';
|
||||
file = pkgs.writeText "rfive.de_zone.txt" ''
|
||||
{ pkgs, config, ... }:
|
||||
let
|
||||
zonefile = pkgs.writeText "rfive.de.zone.txt" ''
|
||||
$TTL 3600
|
||||
$ORIGIN rfive.de.
|
||||
|
||||
rfive.de. 86400 IN SOA ns.rfive.de. hostmaster.rfive.de. 2024030836 10800 3600 604800 3600
|
||||
rfive.de. 86400 IN SOA ns.rfive.de. hostmaster.rfive.de. 2024030838 10800 3600 604800 3600
|
||||
@ NS ns0.rfive.de.
|
||||
@ NS ns.inwx.de.
|
||||
@ NS ns2.inwx.de.
|
||||
|
@ -59,9 +48,30 @@
|
|||
trucks CNAME falkenstein.rfive.de.
|
||||
vault CNAME nuc.rfive.de.
|
||||
'';
|
||||
in
|
||||
{
|
||||
services.bind = rec {
|
||||
enable = true;
|
||||
directory = "/var/lib/bind";
|
||||
zones = {
|
||||
"rfive.de" = {
|
||||
master = true;
|
||||
slaves = [
|
||||
"185.181.104.96"
|
||||
];
|
||||
extraConfig = ''
|
||||
also-notify {185.181.104.96;};
|
||||
dnssec-policy default;
|
||||
inline-signing yes;
|
||||
'';
|
||||
file = "${directory}/rfive.de.zone.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.services.bind.preStart = ''
|
||||
# copy the file manually to its destination since signing requires a writable directory
|
||||
${pkgs.coreutils}/bin/cp ${zonefile} ${config.services.bind.directory}/rfive.de.zone.txt
|
||||
'';
|
||||
networking.firewall.allowedUDPPorts = [ 53 ];
|
||||
networking.firewall.allowedTCPPorts = [ 53 ];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue