summaryrefslogtreecommitdiff
path: root/components/services/bind.nix
diff options
context:
space:
mode:
authorLeonardo <noreply@leoflo.me>2026-03-18 18:33:06 +0100
committerLeonardo <noreply@leoflo.me>2026-03-18 18:33:06 +0100
commit39840ae4e8600a8546563b6521d7df5acb35037e (patch)
tree8797dc66b069e169e9c3924dd4242a567fc1d975 /components/services/bind.nix
parentce4c719159dd659f20e70f95842bbbbad0be23bc (diff)
downloadnixos-39840ae4e8600a8546563b6521d7df5acb35037e.tar.gz
nixos-39840ae4e8600a8546563b6521d7df5acb35037e.zip
dns server
Diffstat (limited to 'components/services/bind.nix')
-rw-r--r--components/services/bind.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/components/services/bind.nix b/components/services/bind.nix
new file mode 100644
index 0000000..79f0608
--- /dev/null
+++ b/components/services/bind.nix
@@ -0,0 +1,31 @@
+{lib, config, pkgs, ...}: {
+ options.bind.enable = lib.mkEnableOption "Bind dns server";
+
+ config = lib.mkIf config.bind.enable {
+ services.bind = {
+ enable = true;
+
+ forwarders = [ "208.67.222.222" "208.67.220.220" ];
+
+ zones = {
+ "home.arpa" = {
+ master = true;
+ allowQuery = [ "127.0.0.0/24" "10.0.69.0/24" ];
+ file = pkgs.writeText "home.arpa" ''
+ $TTL 86400
+ @ IN SOA ns1.home.arpa. admin.home.arpa. (
+ 2026031801 ; serial
+ 3600 ; refresh
+ 900 ; retry
+ 604800 ; expire
+ 86400 ; minimum TTL
+ )
+ @ IN NS ns1.home.arpa.
+ ns1 IN A 10.69.0.1
+ @ IN A 10.69.0.1
+ '';
+ };
+ };
+ };
+ };
+}