2025-05-12 18:58:49 +02:00
|
|
|
{ lib, pkgs, ... }:
|
2019-04-04 19:38:56 +01:00
|
|
|
|
2025-05-12 18:58:49 +02:00
|
|
|
{
|
|
|
|
name = "powerdns-recursor";
|
|
|
|
meta.maintainers = with lib.maintainers; [ rnhmjoj ];
|
2019-04-04 19:38:56 +01:00
|
|
|
|
2025-05-12 18:58:49 +02:00
|
|
|
nodes.server = {
|
|
|
|
services.pdns-recursor.enable = true;
|
|
|
|
services.pdns-recursor.exportHosts = true;
|
|
|
|
services.pdns-recursor.old-settings.dnssec-log-bogus = true;
|
|
|
|
networking.hosts."192.0.2.1" = [ "example.com" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
with subtest("pdns-recursor is running"):
|
2024-12-10 20:26:33 +01:00
|
|
|
server.wait_for_unit("pdns-recursor")
|
|
|
|
server.wait_for_open_port(53)
|
2025-05-12 18:58:49 +02:00
|
|
|
|
|
|
|
with subtest("can resolve names"):
|
2024-12-10 20:26:33 +01:00
|
|
|
assert "192.0.2.1" in server.succeed("host example.com localhost")
|
2025-05-12 18:58:49 +02:00
|
|
|
|
|
|
|
with subtest("old-settings have been merged in"):
|
|
|
|
server.succeed("${lib.getExe pkgs.yq-go} -e .dnssec.log_bogus /etc/pdns-recursor/recursor.yml")
|
|
|
|
'';
|
|
|
|
}
|