Archived
Add global DNS search domain to fix NFS mounts on lxc-docker
Check NixOS configurations / eval-hosts (pull_request) Failing after 40m2s
Check NixOS configurations / eval-hosts (pull_request) Failing after 40m2s
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T48qgH3VTvs8wvwj44FEbE
This commit is contained in:
@@ -13,6 +13,24 @@
|
|||||||
|
|
||||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
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)
|
# Recommended over the true default (bypasses ZFS's own import safeguards)
|
||||||
# per the option's own docs; matches hosts/docker/host.nix and
|
# per the option's own docs; matches hosts/docker/host.nix and
|
||||||
# modules/services/zfs/enable-service.nix, which already set this
|
# modules/services/zfs/enable-service.nix, which already set this
|
||||||
|
|||||||
Reference in New Issue
Block a user