summaryrefslogtreecommitdiff
path: root/hosts/surtr/dns/default.nix
blob: 3fe76dbf50f0114ec8327ce0a7596d4fd168c976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{...}:
{
  config = {
    fileSystems."/var/lib/knot" =
      { device = "surtr/safe/var-lib-knot";
        fsType = "zfs";
      };

    firewall = {
      allowedTCPPorts = [
        53 # DNS
      ];
      allowedUDPPorts = [
        53 # DNS
      ];
    };
    
    services.knot = {
      enable = true;
      extraConfig = ''
        server:
          listen: 127.0.0.1@53
          listen: ::1@53
          listen: 202.61.241.61@53
          listen: 2a03:4000:52:ada::@53

        template:
         - id: default
           storage: /var/lib/knot
           zonefile-sync: -1
           zonefile-load: difference-no-serial
           semantic-checks: on
           dnssec-signing: on
           notify: inwx
           acl: [inwx_acl]

        policy:
          - id: rsa
            algorithm: RSASHA256
            ksk-size: 4096
            zsk-size: 2048
            zsk-lifetime: 30d

        remote:
          - id: inwx
            address: 185.181.104.96@53

        acl:
          - id: inwx_acl
            address: 185.181.104.96
            action: transfer

        zone:
          - domain: yggdrasil.li
            file: ${./zones/li.yggdrasil.soa}
        zone:
          - domain: nights.email
            file: ${./zones/email.nights.soa}
        zone:
          - domain: 141.li
            file: ${./zones/li.141.soa}
        zone:
          - domain: kleen.li
            file: ${./zones/li.kleen.soa}
        zone:
          - domain: xmpp.li
            file: ${./zones/li.xmpp.soa}
        zone:
          - domain: dirty-haskell.org
            file: ${./zones/org.dirty-haskell.soa}
        zone:
          - domain: praseodym.org
            file: ${./zones/org.praseodym.soa}
        zone:
          - domain: rheperire.org
            file: ${./zones/org.rheperire.soa}
      '';
    };
  };
}