forked from malobeo/infrastructure
[dns] init
This commit is contained in:
39
machines/modules/malobeo/zones.nix
Normal file
39
machines/modules/malobeo/zones.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ inputs }:
|
||||
|
||||
let
|
||||
vpnNS = "vpn";
|
||||
localNS = "hq";
|
||||
peers = import ./peers.nix;
|
||||
hosts = ((import ../../hosts.nix ) {}).malobeo.hosts;
|
||||
|
||||
in
|
||||
{
|
||||
SOA = {
|
||||
nameServer = "ns1";
|
||||
adminEmail = "admin@malobeo.org";
|
||||
serial = 2019030800;
|
||||
};
|
||||
useOrigin = false;
|
||||
|
||||
NS = [
|
||||
"ns1.malobeo.org."
|
||||
];
|
||||
|
||||
A = [ "23.23.23.23" ]; #TODO: update
|
||||
AAAA = [ "4321:0:1:2:3:4:567:89ab" ]; #TODO: update
|
||||
|
||||
subdomains = {
|
||||
${localNS} = {
|
||||
subdomains = builtins.mapAttrs (name: value: if value.network.local == true then {
|
||||
A = [ value.network.address ];
|
||||
} else {}) hosts;
|
||||
};
|
||||
|
||||
${vpnNS} = {
|
||||
A = [ peers.vpn.address ];
|
||||
subdomains = builtins.mapAttrs (name: value: if value.role != "server" then {
|
||||
A = [ value.address ];
|
||||
} else {}) peers;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user