fix: don't overwrite split-horizon Corefile from _bootstrap_dns
Unit Tests / test (push) Successful in 7m29s

The apply_all_dns_rules() call at the end of _bootstrap_dns() was
added to force reload 30s into the Corefile on startup. Now that
reload 30s is removed (it broke CoreDNS zone serving), the call is
unnecessary in LAN mode and actively harmful in DDNS mode:
update_split_horizon_zone() already writes the correct Corefile
with the split-horizon block; the subsequent apply_all_dns_rules()
call would overwrite it without the split-horizon zones, causing
all service subdomain lookups to return NXDOMAIN.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 04:56:41 -04:00
parent 0507445d86
commit 4ebcb1d077
+3 -5
View File
@@ -414,13 +414,11 @@ def _bootstrap_dns():
if effective_domain and effective_domain != domain: if effective_domain and effective_domain != domain:
import ip_utils import ip_utils
caddy_ip = ip_utils.get_service_ips(ip_range).get('caddy', '172.20.0.2') caddy_ip = ip_utils.get_service_ips(ip_range).get('caddy', '172.20.0.2')
# update_split_horizon_zone writes both the zone file and the Corefile
# (with the split-horizon block included). No separate apply_all_dns_rules
# call needed — that would overwrite the Corefile and drop the split-horizon block.
network_manager.update_split_horizon_zone( network_manager.update_split_horizon_zone(
effective_domain, caddy_ip, primary_domain=domain) effective_domain, caddy_ip, primary_domain=domain)
# Regenerate the Corefile so any new zone blocks or reload options take
# effect immediately without waiting for the next peer modification.
firewall_manager.apply_all_dns_rules(
peer_registry.list_peers(), COREFILE_PATH, domain,
cell_links=cell_link_manager.list_connections())
except Exception as e: except Exception as e:
logger.warning(f"DNS bootstrap failed (non-fatal): {e}") logger.warning(f"DNS bootstrap failed (non-fatal): {e}")