Simon Bruder
a1facf530f
DNS over HTTPS often is unreliable in practice (did not empirically test this).
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
services.dnsmasq = {
|
|
enable = true;
|
|
|
|
extraConfig = ''
|
|
bogus-priv # do not forward revese lookups of internal addresses
|
|
domain-needed # do not forward names without domain
|
|
local-service # only respond to queries from local network
|
|
no-hosts # do not resolve hosts from /etc/hosts
|
|
no-resolv # only use explicitly configured resolvers
|
|
|
|
server=/fritz.box/192.168.100.1
|
|
|
|
domain=home.sbruder.de
|
|
|
|
dhcp-range=192.168.100.20,192.168.100.150,12h
|
|
dhcp-option=option:router,192.168.100.1
|
|
'';
|
|
servers = [
|
|
"194.150.168.168" # dns.as250.net
|
|
];
|
|
};
|
|
|
|
# Make `local-service` work (requires network interface with all addresses)
|
|
systemd.services.dnsmasq = {
|
|
after = [ "network-online.target" ];
|
|
wants = [ "network-online.target" ];
|
|
};
|
|
|
|
services.prometheus.exporters.dnsmasq = {
|
|
enable = true;
|
|
listenAddress = "127.0.0.1";
|
|
leasesPath = "/var/lib/dnsmasq/dnsmasq.leases";
|
|
};
|
|
|
|
networking.firewall.allowedUDPPorts = [ 53 67 ];
|
|
networking.firewall.allowedTCPPorts = [ 53 ];
|
|
}
|