nixos/home: Anchor static hi clients' DNS on VIPs
Update docs / update (push) Successful in 1m10s
CI / Check, build and cache nixfiles (push) Has been cancelled

Statically-addressed home servers on hi run no DHCP, so they learned a
resolver only from the v6 RA RDNSS and lost DNS whenever v6 (and thus
the RA) was absent. Factor the fix castle/palace applied inline into a
shared lib.my.c.home.vlanDns helper that points resolved at the VLAN's
VRRP VIPs (always-present static v4, plus v6 when up) and sets the
advertised search domains, then apply it to every statically-addressed
hi client: castle, palace, cellar, sfh and the sfh hass/unifi
containers. Document it under the router client DNS section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 22:27:47 +01:00
parent f9f61e19ad
commit b9bcb1eaeb
8 changed files with 43 additions and 17 deletions
+2 -6
View File
@@ -2,7 +2,7 @@
let
inherit (lib.my) net;
inherit (lib.my.c) networkd;
inherit (lib.my.c.home) domain searchDomains vlans prefixes vips roceBootModules;
inherit (lib.my.c.home) domain vlans prefixes vips vlanDns roceBootModules;
in
{
nixos.systems.castle = {
@@ -190,11 +190,7 @@ in
"40-lan-hi" = mkMerge [
(networkdAssignment "lan-hi" assignments.hi)
{
networkConfig = {
# v6 is RA/SLAAC-derived, so when RA is absent we have no v6 at all;
# anchor DNS on the always-present static v4 (the VRRP VIP follows the master)
DNS = [ vips.hi.v4 vips.hi.v6 ];
Domains = searchDomains;
networkConfig = vlanDns "hi" // {
# So we don't drop the IP we use to connect to NVMe-oF!
KeepConfiguration = "static";
};
+5 -2
View File
@@ -2,7 +2,7 @@
let
inherit (lib.my) net mkVLAN;
inherit (lib.my.c) pubDomain;
inherit (lib.my.c.home) domain vlans prefixes vips hiMTU;
inherit (lib.my.c.home) domain vlans prefixes vips vlanDns hiMTU;
in
{
imports = [ ./vms ];
@@ -203,7 +203,10 @@ in
MACAddress=52:54:00:90:34:95
'';
};
"60-lan-hi" = networkdAssignment "lan-hi" assignments.hi;
"60-lan-hi" = mkMerge [
(networkdAssignment "lan-hi" assignments.hi)
{ networkConfig = vlanDns "hi"; }
];
"50-lan-core-phy" = {
matchConfig.Name = "lan-core-phy";
@@ -2,7 +2,7 @@
let
inherit (lib.my) net;
inherit (lib.my.c) pubDomain;
inherit (lib.my.c.home) domain prefixes vips hiMTU;
inherit (lib.my.c.home) domain prefixes vips vlanDns hiMTU;
in
{
nixos.systems.cellar = {
@@ -79,7 +79,10 @@ in
};
networks = {
"80-lan-hi" = networkdAssignment "lan-hi" assignments.hi;
"80-lan-hi" = mkMerge [
(networkdAssignment "lan-hi" assignments.hi)
{ networkConfig = vlanDns "hi"; }
];
};
};
@@ -2,7 +2,7 @@
let
inherit (lib.my) net;
inherit (lib.my.c) pubDomain;
inherit (lib.my.c.home) domain prefixes vips hiMTU;
inherit (lib.my.c.home) domain prefixes vips vlanDns hiMTU;
in
{
nixos.systems.hass = { config, ... }: {
@@ -82,7 +82,10 @@ in
systemd = {
network.networks = {
"80-container-host0" = networkdAssignment "host0" assignments.hi;
"80-container-host0" = mkMerge [
(networkdAssignment "host0" assignments.hi)
{ networkConfig = vlanDns "hi"; }
];
"80-container-lan-lo" = networkdAssignment "lan-lo" assignments.lo;
};
};
@@ -1,7 +1,7 @@
{ lib, ... }:
let
inherit (lib.my) net;
inherit (lib.my.c.home) domain prefixes vips hiMTU;
inherit (lib.my.c.home) domain prefixes vips vlanDns hiMTU;
in
{
nixos.systems.unifi = { config, ... }: {
@@ -58,7 +58,10 @@ in
systemd = {
network.networks = {
"80-container-host0" = networkdAssignment "host0" assignments.hi;
"80-container-host0" = mkMerge [
(networkdAssignment "host0" assignments.hi)
{ networkConfig = vlanDns "hi"; }
];
"80-lan-core" = networkdAssignment "lan-core" assignments.core;
};
};
+5 -3
View File
@@ -1,7 +1,7 @@
{ lib, ... }:
let
inherit (lib.my) net;
inherit (lib.my.c.home) domain prefixes vips hiMTU roceBootModules;
inherit (lib.my.c.home) domain prefixes vips vlanDns hiMTU roceBootModules;
in
{
imports = [ ./containers ];
@@ -134,8 +134,10 @@ in
networks = {
"30-lan-hi" = mkMerge [
(networkdAssignment "lan-hi" assignments.hi)
# So we don't drop the IP we use to connect to NVMe-oF!
{ networkConfig.KeepConfiguration = "static"; }
{
# So we don't drop the IP we use to connect to NVMe-oF!
networkConfig = vlanDns "hi" // { KeepConfiguration = "static"; };
}
];
"30-lan-hi-ctrs" = {
matchConfig.Name = "lan-hi-ctrs";