mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 21:19:07 +01:00
dns: Disable forwarding and resolve all requests yourself
This commit is contained in:
parent
56c7b22bf1
commit
3df7d8f5f0
1 changed files with 21 additions and 33 deletions
|
|
@ -16,41 +16,29 @@ in
|
||||||
unbound = {
|
unbound = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
settings = {
|
settings.server = {
|
||||||
server = {
|
interface = [ netCfg.overlay.interface ];
|
||||||
interface = [ netCfg.overlay.interface ];
|
access-control = [ "${toString netCfg.overlay.networkCidr} allow" ];
|
||||||
access-control = [
|
|
||||||
"${toString netCfg.overlay.networkCidr} allow"
|
|
||||||
];
|
|
||||||
|
|
||||||
local-zone = "\"${netCfg.overlay.domain}.\" static";
|
local-zone = "\"${netCfg.overlay.domain}.\" static";
|
||||||
local-data =
|
local-data =
|
||||||
let
|
let
|
||||||
nodeRecords =
|
nodeRecords =
|
||||||
netCfg.nodes
|
netCfg.nodes
|
||||||
|> lib.map (node: "\"${node.hostName}.${node.overlay.domain}. A ${node.overlay.address}\"");
|
|> lib.map (node: "\"${node.hostName}.${node.overlay.domain}. A ${node.overlay.address}\"");
|
||||||
serviceRecords =
|
serviceRecords =
|
||||||
self.nixosConfigurations
|
self.nixosConfigurations
|
||||||
|
|> lib.attrValues
|
||||||
|
|> lib.concatMap (
|
||||||
|
host:
|
||||||
|
host.config.custom.services.caddy.virtualHosts
|
||||||
|> lib.attrValues
|
|> lib.attrValues
|
||||||
|> lib.concatMap (
|
|> lib.map (vHost: vHost.domain)
|
||||||
host:
|
|> lib.filter (domain: self.lib.isPrivateDomain domain)
|
||||||
host.config.custom.services.caddy.virtualHosts
|
|> lib.map (domain: "\"${domain}. A ${host.config.custom.networking.overlay.address}\"")
|
||||||
|> lib.attrValues
|
);
|
||||||
|> lib.map (vHost: vHost.domain)
|
in
|
||||||
|> lib.filter (domain: self.lib.isPrivateDomain domain)
|
nodeRecords ++ serviceRecords;
|
||||||
|> lib.map (domain: "\"${domain}. A ${host.config.custom.networking.overlay.address}\"")
|
|
||||||
);
|
|
||||||
in
|
|
||||||
nodeRecords ++ serviceRecords;
|
|
||||||
};
|
|
||||||
|
|
||||||
forward-zone = lib.singleton {
|
|
||||||
name = ".";
|
|
||||||
forward-addr = [
|
|
||||||
"1.1.1.1"
|
|
||||||
"8.8.8.8"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue