1import ./make-test-python.nix {
2 name = "bind";
3
4 nodes.machine = { pkgs, lib, ... }: {
5 services.bind.enable = true;
6 services.bind.extraOptions = "empty-zones-enable no;";
7 services.bind.zones = lib.singleton {
8 name = ".";
9 master = true;
10 file = pkgs.writeText "root.zone" ''
11 $TTL 3600
12 . IN SOA ns.example.org. admin.example.org. ( 1 3h 1h 1w 1d )
13 . IN NS ns.example.org.
14
15 ns.example.org. IN A 192.168.0.1
16 ns.example.org. IN AAAA abcd::1
17
18 1.0.168.192.in-addr.arpa IN PTR ns.example.org.
19 '';
20 };
21 };
22
23 testScript = ''
24 machine.wait_for_unit("bind.service")
25 machine.wait_for_open_port(53)
26 machine.succeed("host 192.168.0.1 127.0.0.1 | grep -qF ns.example.org")
27 '';
28}