aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/dn/dns
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/dn/dns')
-rw-r--r--modules/by-name/dn/dns/module.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/by-name/dn/dns/module.nix b/modules/by-name/dn/dns/module.nix
index 8f4ad37..cbd8d03 100644
--- a/modules/by-name/dn/dns/module.nix
+++ b/modules/by-name/dn/dns/module.nix
@@ -63,6 +63,25 @@ in {
};
config = lib.mkIf cfg.enable {
+ vhack.persist.directories = [
+ {
+ directory = "/var/lib/unbound";
+ user = "unbound";
+ group = "unbound";
+ mode = "0700";
+ }
+ ];
+
+ # Use unbound for resolving all local DNS queries.
+ # unbounds also has the upside to verify DNSSEC.
+ services.unbound = {
+ enable = true;
+ stateDir = "/var/lib/unbound";
+ resolveLocalQueries = true;
+ };
+
+ # Use nsd to serve our own zone files, with the configured NS record pointing to the
+ # servers ip address.
services.nsd = {
enable = true;
verbosity = 4;
@@ -82,5 +101,13 @@ in {
"network-online.target"
];
};
+ users = {
+ users = {
+ "unbound".uid = config.vhack.constants.ids.uids.unbound;
+ };
+ groups = {
+ "unbound".gid = config.vhack.constants.ids.gids.unbound;
+ };
+ };
};
}