1{ lib, pkgs, ... }:
2
3{
4 name = "powerdns-recursor";
5 meta.maintainers = with lib.maintainers; [ rnhmjoj ];
6
7 nodes.server = {
8 services.pdns-recursor.enable = true;
9 services.pdns-recursor.exportHosts = true;
10 services.pdns-recursor.old-settings.dnssec-log-bogus = true;
11 networking.hosts."192.0.2.1" = [ "example.com" ];
12 };
13
14 testScript = ''
15 with subtest("pdns-recursor is running"):
16 server.wait_for_unit("pdns-recursor")
17 server.wait_for_open_port(53)
18
19 with subtest("can resolve names"):
20 assert "192.0.2.1" in server.succeed("host example.com localhost")
21
22 with subtest("old-settings have been merged in"):
23 server.succeed("${lib.getExe pkgs.yq-go} -e .dnssec.log_bogus /etc/pdns-recursor/recursor.yml")
24 '';
25}