diff options
| author | Soispha Peetz <soispha@b-peetz.de> | 2026-11-25 19:29:54 +0100 |
|---|---|---|
| committer | Soispha Peetz <soispha@b-peetz.de> | 2026-11-27 00:55:53 +0100 |
| commit | d76f348bc117a8c972ce3447591ef507293cc7f1 (patch) | |
| tree | f9f2d6dab4bd023490c9e3b80192e5d84336580c /modules/by-name/dn/dns | |
| parent | hosts/server2: Upgrade to nextcloud34 (diff) | |
| download | nixos-server-d76f348bc117a8c972ce3447591ef507293cc7f1.zip | |
modules/dns: Also use a resolving dns server
nsd only does the authoritative dns hosting (think a web server), but
unbound does the actual dns querying, with DNSSEC resolving and
everything.
Before that we implicitly had kresd, as that was what the snm had
enabled, but unbound and nsd are meant to work together (both from NLNet).
Diffstat (limited to 'modules/by-name/dn/dns')
| -rw-r--r-- | modules/by-name/dn/dns/module.nix | 27 |
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; + }; + }; }; } |
