From e176ff723d194e13bccae14ed100ba21e718cd34 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Mon, 20 Jul 2026 18:22:12 +0000 Subject: [PATCH] Add global DNS search domain to fix NFS mounts on lxc-docker Cross-host references throughout this repo (vars.nfsServerHost, vars.nixCacheHost, vars.dockerHost) are bare short names, not FQDNs. Resolving them has always depended on whatever network stack happens to be in play picking up the DHCP-advertised domain as a search suffix -- NetworkManager does this by default, which is why it went unnoticed everywhere else, but LXC containers force-disable NetworkManager and get their systemd-networkd config written directly by Proxmox instead, which never sets one. Confirmed live on lxc-docker (vmid 105) after today's earlier fix for the automount/mount=nfs bugs: systemd-resolved had no search domain for eth0, so "server" failed to resolve ("Name or service not known") while "server.sweet.home" resolved fine via the same DNS server -- every NFS mount in modules/docker/mount-data.nix was still failing. networking.search sets systemd-resolved's own Domains= globally rather than depending on the per-link DHCP path, so it isn't at the mercy of whichever component owns a given host's interface file. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01T48qgH3VTvs8wvwj44FEbE --- modules/common/configuration.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/common/configuration.nix b/modules/common/configuration.nix index 716a848..0abadcc 100644 --- a/modules/common/configuration.nix +++ b/modules/common/configuration.nix @@ -13,6 +13,24 @@ networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + # No host declares a DNS search domain anywhere else, and cross-host + # references throughout this repo (vars.nfsServerHost, vars.nixCacheHost, + # vars.dockerHost, ...) are bare short names, not FQDNs -- resolving them + # depends entirely on whatever network stack happens to be in play + # picking up the DHCP-advertised domain as a search suffix. NetworkManager + # does that by default, which is why this went unnoticed on + # NetworkManager-managed hosts, but LXC containers (modules/platforms/lxc.nix + # force-disables NetworkManager and Proxmox writes their systemd-networkd + # config itself) never get one. Confirmed live on lxc-docker: systemd-resolved + # had no search domain for eth0, "server" failed to resolve + # ("Name or service not known") while "server.sweet.home" resolved fine via + # the same DNS server, so every NFS mount in modules/docker/mount-data.nix + # failed even after fixing the automount/mount=nfs bugs. This applies the + # search domain globally via systemd-resolved's own config rather than the + # per-link DHCP path, so it isn't at the mercy of whichever component owns + # a given host's interface file. + networking.search = [ vars.homeDomain ]; + # Recommended over the true default (bypasses ZFS's own import safeguards) # per the option's own docs; matches hosts/docker/host.nix and # modules/services/zfs/enable-service.nix, which already set this -- 2.54.0