feat(tyr): setup local dns with blocky+unbound.

This commit is contained in:
CronyAkatsuki 2025-09-27 11:00:32 +02:00
parent 4ef08da3e8
commit 555a489f7d
3 changed files with 52 additions and 5 deletions

View file

@ -6,5 +6,6 @@
./wireguard.nix
./secrets.nix
./nfs-server.nix
./dns.nix
];
}

View file

@ -0,0 +1,49 @@
{
services.resolved.extraConfig = ''
DNSStubListener=no
'';
# Setup blocky for adblocking
services.blocky = {
enable = true;
settings = {
ports.dns = 53;
connectIPVersion = "v4";
upstreams.groups.default = [
"127.0.0.1:553"
];
blocking = {
denylists = {
"pro" = ["https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/wildcard/pro.txt"];
"tif" = ["https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/wildcard/tif.txt"];
};
clientGroupsBlock.default = ["pro" "tif"];
};
caching = {
prefetching = true;
minTime = "1m";
};
};
};
# Setup unbound for recursive dns
services.unbound = {
enable = true;
settings = {
server = {
interface = ["127.0.0.1"];
port = 553;
do-ip4 = true;
do-ip6 = false;
prefetch = true;
cache-max-ttl = 60;
cache-max-negative-ttl = 60;
serve-original-ttl = true;
};
};
};
}