Technitium DNS with failover over dns02
This commit is contained in:
parent
076234c4bd
commit
1efda446f3
13 changed files with 235 additions and 0 deletions
44
modules/networking/technitium-dns-server.nix
Normal file
44
modules/networking/technitium-dns-server.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.networking.technitium-dns-server;
|
||||
defaultPorts = config.services.technitium-dns-server.firewallTCPPorts.default;
|
||||
in
|
||||
{
|
||||
options.my.networking.technitium-dns-server = {
|
||||
enable = lib.mkEnableOption "Enable Technitium DNS Server";
|
||||
dnsOverHttps = lib.mkEnableOption "Enable DNS over HTTPS";
|
||||
adminPasswordFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "";
|
||||
description = ''
|
||||
Path to the file containing the admin password.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.technitium-dns-server = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
firewallTCPPorts = [
|
||||
53
|
||||
5380
|
||||
53443
|
||||
] ++ lib.optional cfg.dnsOverHttps 443;
|
||||
firewallUDPPorts = [
|
||||
53
|
||||
67
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.technitium-dns-server.environment.DNS_SERVER_ADMIN_PASSWORD_FILE =
|
||||
cfg.adminPasswordFile;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue