nixos-config/system/networking.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, ... }:
2021-05-11 20:58:03 +02:00
{
networking.nameservers = [ "127.0.0.1" "::1" ];
services.resolved = {
enable = true;
# don't use fallback resolvers
fallbackDns = [ "127.0.0.1" "::1" ];
2021-05-11 20:58:03 +02:00
};
services.dnscrypt-proxy2 = {
enable = true;
settings = {
listen_addresses = [ "127.0.0.1:53" "[::1]:53" ];
2021-05-11 20:58:03 +02:00
ipv6_servers = true;
require_nolog = true;
require_dnssec = true;
http3 = true;
2021-05-11 20:58:03 +02:00
sources.public-resolvers = {
urls = [
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
];
cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md";
minisign_key =
"RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
2021-05-11 20:58:03 +02:00
};
server_names = [ "mullvad-doh" "controld-unfiltered" ];
2021-05-11 20:58:03 +02:00
};
};
systemd.services.dnscrypt-proxy2.serviceConfig = {
StateDirectory = lib.mkForce "dnscrypt-proxy2";
};
2021-05-26 22:11:26 +02:00
# prefer IPv6
environment.etc."gai.conf".text = ''
label ::1/128 0
label ::/0 1
label 2002::/16 2
label ::/96 3
label ::ffff:0:0/96 4
'';
2021-05-11 20:58:03 +02:00
}