nixos-config/config/services/named.nix

67 lines
1.5 KiB
Nix
Raw Normal View History

2022-01-15 13:44:34 +00:00
{ config, ... }:
let
internalIP = import ../../utils/getInternalIP.nix config;
createListenEntry = ip: "inet ${ip} port 8653 allow { any; };";
2022-01-15 13:44:34 +00:00
listenEntries = builtins.map createListenEntry internalIP.listenIPsBare;
in
{
2022-01-14 19:56:02 +00:00
services.bind = {
enable = true;
zones = {
"darkkirb.de" = {
master = false;
masters = [
"fd00:e621:e621::1"
];
file = "darkkirb.de.zone";
};
"chir.rs" = {
master = false;
masters = [
"fd00:e621:e621::1"
];
file = "chir.rs.zone";
};
"int.chir.rs" = {
master = false;
masters = [
"fd00:e621:e621::1"
];
file = "int.chir.rs.zone";
};
"rpz.int.chir.rs" = {
master = false;
masters = [
"fd00:e621:e621::1"
];
file = "rpz.int.chir.rs.zone";
};
};
2022-01-15 13:44:34 +00:00
extraConfig = ''
statistics-channels {
${toString listenEntries}
2022-01-15 13:46:28 +00:00
};
2022-01-15 13:44:34 +00:00
'';
2022-01-15 14:03:51 +00:00
extraOptions = ''
allow-recursion {
127.0.0.1;
::1;
fc00::/7;
};
recursion yes;
response-policy {
zone "rpz.int.chir.rs";
};
dnssec-validation yes;
'';
2022-01-14 19:56:02 +00:00
};
networking.firewall.allowedTCPPorts = [ 53 ];
networking.firewall.allowedUDPPorts = [ 53 ];
2022-01-15 13:44:34 +00:00
services.prometheus.exporters.bind = {
enable = true;
bindGroups = [ "server" "view" "tasks" ];
bindURI = "http://${internalIP.listenIP}:8653/";
listenAddress = internalIP.listenIP;
};
2022-01-14 19:56:02 +00:00
}