From 0c94611b7a5f6c564d4cc15554fc2ac8b442aba6 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 17:12:00 +0000 Subject: use the host's DNS resolver The guest's resolv.conf and the DHCP server now point at 172.16.0.1, so the host's resolver has to answer there. --- default.nix | 3 ++- host.nix | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index b501b1a..fc2d6e0 100644 --- a/default.nix +++ b/default.nix @@ -53,7 +53,8 @@ let networking.useDHCP = false; networking.resolvconf.enable = false; - environment.etc."resolv.conf".text = "nameserver 9.9.9.9\n"; + # The host's resolver, see host.nix. + environment.etc."resolv.conf".text = "nameserver 172.16.0.1\n"; systemd.network.enable = true; systemd.network.wait-online.enable = false; systemd.network.networks.eth = { diff --git a/host.nix b/host.nix index 378a888..8ee0aea 100644 --- a/host.nix +++ b/host.nix @@ -4,7 +4,8 @@ # number of VMs that can run at the same time. # usage (in the host's configuration.nix): # imports = [ (import ./host.nix { user = "tv"; }) ]; -# The host's firewall has to let the guests in on fcbr0: DHCP (udp 67) +# The host's DNS resolver has to answer on 172.16.0.1, and the host's +# firewall has to let the guests in on fcbr0: DHCP (udp 67) and DNS (53) # as input, and anything from fcbr0 (plus the return traffic) as forward. { user, taps ? 8 }: { lib, pkgs, ... }: let tapNames = map (i: "fctap${toString i}") (lib.range 0 (taps - 1)); @@ -41,7 +42,7 @@ in { "--interface=fcbr0" "--dhcp-authoritative" "--dhcp-range=172.16.0.2,172.16.0.254,1h" - "--dhcp-option=option:dns-server,9.9.9.9" + "--dhcp-option=option:dns-server,172.16.0.1" "--dhcp-leasefile=/run/fcbr0-dhcp/leases" ]; }; -- cgit v1.3.1