aboutsummaryrefslogtreecommitdiffstats
path: root/tests/common/dns
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common/dns')
-rw-r--r--tests/common/dns/client.nix16
-rw-r--r--tests/common/dns/server.nix22
2 files changed, 19 insertions, 19 deletions
diff --git a/tests/common/dns/client.nix b/tests/common/dns/client.nix
index 52f3267..384f1c9 100644
--- a/tests/common/dns/client.nix
+++ b/tests/common/dns/client.nix
@@ -1,10 +1,16 @@
{
- lib,
nodes,
+ lib,
...
}: {
- networking.nameservers = lib.mkForce [
- nodes.name_server.networking.primaryIPAddress
- nodes.name_server.networking.primaryIPv6Address
- ];
+ # In the test environment, we cannot use the root dns servers to perform recursive dns
+ # resolving, as there is no internet access.
+ # Instead of doing the dance with root dns servers and what-not, we just force them
+ # to directly connect to our authoritative dns server for the zones we have.
+ networking.nameservers = lib.mkForce nodes.name_server.vhack.nsd.interfaces;
+
+ # `unbound` might be active, but it's utterly pointless in a test environment (there is
+ # no network access). So we disable it, which means that the nameservers, configured
+ # above, actually mean something.
+ vhack.unbound.enable = lib.mkForce false;
}
diff --git a/tests/common/dns/server.nix b/tests/common/dns/server.nix
index 0c8d72c..a3a603f 100644
--- a/tests/common/dns/server.nix
+++ b/tests/common/dns/server.nix
@@ -1,28 +1,22 @@
{
- lib,
nodes,
+ config,
...
}: {
- imports = [
- ../../../modules
- ];
-
- networking.nameservers = lib.mkForce [
- nodes.name_server.networking.primaryIPAddress
- nodes.name_server.networking.primaryIPv6Address
- ];
-
vhack = {
- dns = {
+ # Enable unbound, so we can resolve our own zones.
+ unbound.enable = true;
+
+ nsd = {
enable = true;
openFirewall = true;
interfaces = [
- nodes.name_server.networking.primaryIPAddress
- nodes.name_server.networking.primaryIPv6Address
+ config.networking.primaryIPAddress
+ config.networking.primaryIPv6Address
];
zones = {
- "acme.test" = {
+ "acme.nixos_test" = {
SOA = {
nameServer = "ns";
adminEmail = "admin@server.com";