2 Commits

Author SHA1 Message Date
jackos1998 14af217880 nixos/castle: Pin static DNS on lan-hi
CI / Check, build and cache nixfiles (push) Successful in 47m5s
Update docs / update (push) Successful in 1m16s
castle took its resolver solely from the IPv6 RA (radvd RDNSS) on
lan-hi, so DNS broke whenever RA was absent. Since castle's own v6 is
RA/SLAAC-derived it has no usable v6 address in that case, so anchor
DNS on the always-present static v4 via the VRRP VIP, with the v6 VIP
as a bonus when v6 is up. Search domains reuse the centralised
lib.my.c.home.searchDomains list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:04:34 +01:00
jackos1998 26e6870337 lib/home: Centralise advertised search domains
radvd's DNSSL and kea's domain-search hardcoded the same list of
search domains in two places. Hoist it to lib.my.c.home.searchDomains
so there is a single source of truth (and so other consumers, such as
statically-configured boxes, can reuse it). No change to what is
advertised.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:04:34 +01:00
4 changed files with 19 additions and 9 deletions
+2
View File
@@ -307,6 +307,8 @@ rec {
home = rec {
domain = "h.${pubDomain}";
# Search domains advertised to clients (radvd DNSSL / kea domain-search)
searchDomains = [ domain "dyn.${domain}" colony.domain britway.domain ];
vlans = {
hi = 100;
lo = 110;
+11 -3
View File
@@ -2,7 +2,7 @@
let
inherit (lib.my) net;
inherit (lib.my.c) networkd;
inherit (lib.my.c.home) domain vlans prefixes vips roceBootModules;
inherit (lib.my.c.home) domain searchDomains vlans prefixes vips roceBootModules;
in
{
nixos.systems.castle = {
@@ -189,8 +189,16 @@ in
};
"40-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"; }
{
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;
# So we don't drop the IP we use to connect to NVMe-oF!
KeepConfiguration = "static";
};
}
];
"45-lan-lo" = {
matchConfig.Name = "lan-lo";
+3 -3
View File
@@ -1,8 +1,8 @@
index: { lib, pkgs, config, assignments, allAssignments, ... }:
let
inherit (lib) mkForce;
inherit (lib) mkForce concatStringsSep;
inherit (lib.my) net netbootKeaClientClasses;
inherit (lib.my.c.home) domain prefixes vips hiMTU;
inherit (lib.my.c.home) domain searchDomains prefixes vips hiMTU;
dns-servers = [
{
@@ -59,7 +59,7 @@ in
}
{
name = "domain-search";
data = "${domain}, dyn.${domain}, ${lib.my.c.colony.domain}, ${lib.my.c.britway.domain}";
data = concatStringsSep ", " searchDomains;
always-send = true;
}
];
+3 -3
View File
@@ -1,8 +1,8 @@
index: { lib, pkgs, ... }:
let
inherit (lib) mkForce concatMapStringsSep;
inherit (lib) mkForce concatMapStringsSep concatStringsSep;
inherit (lib.my) net;
inherit (lib.my.c.home) domain prefixes vips;
inherit (lib.my.c.home) domain searchDomains prefixes vips;
# untrusted uses external (Cloudflare) resolvers, matching the v4 kea config;
# trusted VLANs use the internal recursor via its floating VRRP VIP
@@ -18,7 +18,7 @@ let
AdvLinkMTU ${toString prefixes."${name}".mtu};
prefix ${prefixes."${name}".v6} {};
RDNSS ${rdnss name} {};
DNSSL ${domain} dyn.${domain} ${lib.my.c.colony.domain} ${lib.my.c.britway.domain} {};
DNSSL ${concatStringsSep " " searchDomains} {};
};
'';
in