diff --git a/applications/dns.nix b/applications/dns.nix index 4df6baa..2f935b4 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -62,8 +62,8 @@ let '' $ORIGIN 99.1.193.in-addr.arpa. $TTL 60 ; 1 minute - ; hostmaster@${domain} is an email address that recieves stuff related to dns - @ IN SOA ${cfg.own.nameserver}.${domain}. hostmaster.${domain}. ( + ; hostmaster@skynet.ie is an email address that recieves stuff related to dns + @ IN SOA ${cfg.own.nameserver}.skynet.ie. hostmaster.skynet.ie. ( ; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated ${current_date} 600 ; Refresh (10 minutes) @@ -72,10 +72,10 @@ let 3600 ; Minimum (1 hour) ) - @ NS ns1.${domain}. - @ NS ns2.${domain}. + @ NS ns1.skynet.ie. + @ NS ns2.skynet.ie. - ${lib.strings.concatMapStrings (x: x + "." + domain + ".\n") cfg.records.reverse} + ${lib.strings.concatMapStrings (x: x + "\n") cfg.records.reverse} '' ); diff --git a/applications/email.nix b/applications/email.nix index b660c02..1e2dad0 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -96,6 +96,10 @@ "_dmarc TXT v=DMARC1; p=none" ]; + skynet_dns.records.reverse = [ + "${builtins.substring 9 3 cfg.host.ip} IN PTR ${cfg.sub}.${cfg.domain}." + ]; + mailserver = { enable = true; fqdn = "${cfg.sub}.${cfg.domain}"; diff --git a/machines/agentjones.nix b/machines/agentjones.nix index 066008a..9ea8494 100644 --- a/machines/agentjones.nix +++ b/machines/agentjones.nix @@ -36,7 +36,7 @@ in { ]; cname = []; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; diff --git a/machines/galatea.nix b/machines/galatea.nix index a87c570..dde7ad3 100644 --- a/machines/galatea.nix +++ b/machines/galatea.nix @@ -35,7 +35,7 @@ in { "${name} A ${ip_pub}" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; diff --git a/machines/gir.nix b/machines/gir.nix index 2594441..9886c6b 100644 --- a/machines/gir.nix +++ b/machines/gir.nix @@ -38,7 +38,7 @@ in { "${name} A ${ip_pub}" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; diff --git a/machines/glados.nix b/machines/glados.nix index c1fce22..e0ae46b 100644 --- a/machines/glados.nix +++ b/machines/glados.nix @@ -38,7 +38,7 @@ in { "${name} A ${ip_pub}" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; diff --git a/machines/kitt.nix b/machines/kitt.nix index 05f352b..5c6c268 100644 --- a/machines/kitt.nix +++ b/machines/kitt.nix @@ -38,7 +38,7 @@ in { "${name} A ${ip_pub}" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; diff --git a/machines/optimus.nix b/machines/optimus.nix index bf0a372..a72d2c0 100644 --- a/machines/optimus.nix +++ b/machines/optimus.nix @@ -36,7 +36,7 @@ in { "${name} A ${ip_pub}" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; diff --git a/machines/vendetta.nix b/machines/vendetta.nix index fd73889..b506e2b 100644 --- a/machines/vendetta.nix +++ b/machines/vendetta.nix @@ -66,7 +66,7 @@ in { #"misc CNAME vendetta" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; @@ -95,6 +95,18 @@ in { else [] ) nodes ); + + reverse = builtins.concatLists ( + lib.attrsets.mapAttrsToList (key: value: + if builtins.hasAttr "skynet_dns" value.config + then ( + if value.config.skynet_dns.enable + then value.config.skynet_dns.own.reverse + else value.config.skynet_dns.records.reverse + ) + else [] + ) nodes + ); }; }; diff --git a/machines/vigil.nix b/machines/vigil.nix index f2ab9cf..82fb7b6 100644 --- a/machines/vigil.nix +++ b/machines/vigil.nix @@ -47,7 +47,7 @@ in { #"misc CNAME vendetta" ]; reverse = [ - "${builtins.substring 9 3 ip_pub} IN PTR ${name}" + "${builtins.substring 9 3 ip_pub} IN PTR ${hostname}." ]; }; @@ -76,6 +76,18 @@ in { else [] ) nodes ); + + reverse = builtins.concatLists ( + lib.attrsets.mapAttrsToList (key: value: + if builtins.hasAttr "skynet_dns" value.config + then ( + if value.config.skynet_dns.enable + then value.config.skynet_dns.own.reverse + else value.config.skynet_dns.records.reverse + ) + else [] + ) nodes + ); }; };