From 1f5eda31b2a2c02aa64d69249c4907161e089614 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 4 Jan 2025 18:46:37 -0500 Subject: [PATCH] removed throw, renamed services.named to services.bind --- modules/networking/dns.nix | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/modules/networking/dns.nix b/modules/networking/dns.nix index 1a94c8b..fc9b9a1 100644 --- a/modules/networking/dns.nix +++ b/modules/networking/dns.nix @@ -69,16 +69,9 @@ in { }; }; - # Validate that only one DNS server is enabled - imports = [ - (lib.mkIf (cfg.bind.enable && cfg.technitium.enable) (throw "Only one DNS server can be enabled at a time")) - ]; - - # Implementation of the configuration config = lib.mkMerge [ - # BIND DNS Server Configuration (lib.mkIf cfg.bind.enable { - services.named = { + services.bind = { enable = true; interfaces = cfg.bind.settings.interfaces; zones = @@ -97,9 +90,7 @@ in { environment.systemPackages = [pkgs.bind]; }) - # Technitium DNS Server Configuration (lib.mkIf cfg.technitium.enable { - # Create a systemd service for Technitium systemd.services.technitium-dns = { description = "Technitium DNS Server"; wantedBy = ["multi-user.target"]; @@ -123,8 +114,8 @@ in { }; networking.firewall = { - allowedTCPPorts = [cfg.technitium.settings.port]; - allowedUDPPorts = [cfg.technitium.settings.port]; + allowedTCPPorts = [53 cfg.technitium.settings.port]; + allowedUDPPorts = [53 cfg.technitium.settings.port]; }; environment.systemPackages = [pkgs.technitium];