DNS: replace the *.animeteamspeak.moe wildcard with explicit records (external-dns) #1708

Open
opened 2026-11-17 03:54:28 +00:00 by ginjiruu · 3 comments
Owner

At the 2026-11-16 router swap, the routers' DHCP handed out the search domain caosh.int.animeteamspeak.moe. Pods resolve with ndots:5, so they tried every external name under it first, and the public wildcard *.animeteamspeak.moe answered with our own IP. cloudflare-ddns and every new pod on mini lost the internet. The DHCP domain is gone now (lab/iac#127), but the wildcard still answers for any name under the zone: typos, scanner guesses, internal names.

Plan:

  1. external-dns with the Cloudflare provider, sourced from the Gateway/HTTPRoute (and Ingress) hostnames. Each record is a CNAME to the apex (external-dns.alpha.kubernetes.io/target: animeteamspeak.moe), not proxied, with the TXT ownership registry.
  2. cloudflare-ddns keeps only the apex A record, so one IP update moves everything. Drop the wildcard record from its job.
  3. Delete the wildcard once external-dns owns every published name. Diff the current names against routes first.
  4. Internal names (caosh.int.animeteamspeak.moe) are served only by the internal resolver (PowerDNS, #1673), with split-horizon views for the public names (LAN answers the LoadBalancer IPs). After that, the DHCP search domain can come back, and hairpin NAT stays only as a fallback.

Stopgap if needed before then: any record at int.animeteamspeak.moe stops the wildcard from matching names below it.

Search keywords: TODO dns wildcard external-dns split horizon.

At the 2026-11-16 router swap, the routers' DHCP handed out the search domain `caosh.int.animeteamspeak.moe`. Pods resolve with ndots:5, so they tried every external name under it first, and the public wildcard `*.animeteamspeak.moe` answered with our own IP. cloudflare-ddns and every new pod on mini lost the internet. The DHCP domain is gone now (lab/iac#127), but the wildcard still answers for any name under the zone: typos, scanner guesses, internal names. Plan: 1. external-dns with the Cloudflare provider, sourced from the Gateway/HTTPRoute (and Ingress) hostnames. Each record is a CNAME to the apex (`external-dns.alpha.kubernetes.io/target: animeteamspeak.moe`), not proxied, with the TXT ownership registry. 2. cloudflare-ddns keeps only the apex A record, so one IP update moves everything. Drop the wildcard record from its job. 3. Delete the wildcard once external-dns owns every published name. Diff the current names against routes first. 4. Internal names (`caosh.int.animeteamspeak.moe`) are served only by the internal resolver (PowerDNS, #1673), with split-horizon views for the public names (LAN answers the LoadBalancer IPs). After that, the DHCP search domain can come back, and hairpin NAT stays only as a fallback. Stopgap if needed before then: any record at `int.animeteamspeak.moe` stops the wildcard from matching names below it. Search keywords: TODO dns wildcard external-dns split horizon.
Author
Owner

Split-horizon in place of hairpin NAT as the main LAN path (2026-11-16)

Today LAN clients reach our public names through hairpin NAT on the routers (lab/iac#121). It works, but:

  • services see the router (10.15.1.252/.253), not the real client: logs, rate limits and IP allowlists lose the client
  • every LAN request makes an extra NAT trip through the router
  • the routers' PUBLIC-IP list follows DNS, so after a WAN failover (each router has its own PPPoE IP, lab/iac#128) LAN access to our own services waits for cloudflare-ddns

With split-horizon, the internal resolver (PowerDNS, #1673) answers the public names with the LoadBalancer IPs (10.10.6.x). Traffic is routed over BGP with no NAT, and the client IP is preserved. external-dns can feed both views from the same Gateway/HTTPRoute hostnames (Cloudflare provider for public, PowerDNS provider for internal), so there's no second list to maintain.

Before turning it on

  • Asymmetric path. mini (10.15.1.170) shares 10.15.1.0/24 with LAN clients. Without NAT, client -> router -> LB IP on mini works, but mini replies straight to the client on the shared L2. The router sees half the connection and its forward drop invalid kills it. Today the hairpin masquerade (LAN-NETS -> PUBLISHED) hides this. Fix: move mini to the servers VLAN (20), so clients and servers are always routed, or keep that masquerade for clients on mini's subnet.
  • Keep hairpin as the fallback. Clients that skip our resolver still get the public IP: browser DoH, Android Private DNS, hard-coded 8.8.8.8, IoT. Serving use-application-dns.net as NXDOMAIN internally turns Firefox's default DoH off.

Downsides to plan for

  • Two views can drift. A name exists publicly but not internally, or points at the wrong place. external-dns writing both views from the same source is the mitigation.
  • Roaming clients cache the LAN answer. A laptop or phone that leaves the LAN keeps 10.10.6.x until the TTL runs out. Keep internal TTLs short (60-300 s).
  • The resolver becomes critical. If PowerDNS (on c1) is down, LAN clients fall back to the public resolvers and land on hairpin. That's fine as long as hairpin stays, and it's another reason to keep it. Keep bootstrap-critical names off it (lab/iac#50).
  • DNSSEC. If animeteamspeak.moe is ever signed at Cloudflare, the internal view must be authoritative for (or forwarded and not validated for) those names on our resolver. A validating resolver would otherwise reject the different internal answers.
  • Debugging. The same name answers differently inside and outside. "Works from home, not from LTE" needs both views checked.

Search keywords: TODO split horizon hairpin powerdns external-dns.

## Split-horizon in place of hairpin NAT as the main LAN path (2026-11-16) Today LAN clients reach our public names through hairpin NAT on the routers (lab/iac#121). It works, but: - services see the router (10.15.1.252/.253), not the real client: logs, rate limits and IP allowlists lose the client - every LAN request makes an extra NAT trip through the router - the routers' `PUBLIC-IP` list follows DNS, so after a WAN failover (each router has its own PPPoE IP, lab/iac#128) LAN access to our own services waits for cloudflare-ddns With split-horizon, the internal resolver (PowerDNS, #1673) answers the public names with the LoadBalancer IPs (10.10.6.x). Traffic is routed over BGP with no NAT, and the client IP is preserved. external-dns can feed both views from the same Gateway/HTTPRoute hostnames (Cloudflare provider for public, PowerDNS provider for internal), so there's no second list to maintain. ### Before turning it on - **Asymmetric path.** mini (10.15.1.170) shares 10.15.1.0/24 with LAN clients. Without NAT, client -> router -> LB IP on mini works, but mini replies straight to the client on the shared L2. The router sees half the connection and its forward `drop invalid` kills it. Today the hairpin masquerade (`LAN-NETS -> PUBLISHED`) hides this. Fix: move mini to the servers VLAN (20), so clients and servers are always routed, or keep that masquerade for clients on mini's subnet. - **Keep hairpin as the fallback.** Clients that skip our resolver still get the public IP: browser DoH, Android Private DNS, hard-coded 8.8.8.8, IoT. Serving `use-application-dns.net` as NXDOMAIN internally turns Firefox's default DoH off. ### Downsides to plan for - **Two views can drift.** A name exists publicly but not internally, or points at the wrong place. external-dns writing both views from the same source is the mitigation. - **Roaming clients cache the LAN answer.** A laptop or phone that leaves the LAN keeps 10.10.6.x until the TTL runs out. Keep internal TTLs short (60-300 s). - **The resolver becomes critical.** If PowerDNS (on c1) is down, LAN clients fall back to the public resolvers and land on hairpin. That's fine as long as hairpin stays, and it's another reason to keep it. Keep bootstrap-critical names off it (lab/iac#50). - **DNSSEC.** If `animeteamspeak.moe` is ever signed at Cloudflare, the internal view must be authoritative for (or forwarded and not validated for) those names on our resolver. A validating resolver would otherwise reject the different internal answers. - **Debugging.** The same name answers differently inside and outside. "Works from home, not from LTE" needs both views checked. Search keywords: TODO split horizon hairpin powerdns external-dns.
Author
Owner

2026-11-22: the user deleted the Cloudflare wildcard record (step 3).

Fallout check:

  • Broken: cloudflare-ddns (mini ddns-system). The 21:30Z job failed: it updated the apex, then the PATCH to the wildcard id 1125532a… returned 404. Fix: drop WILDCARD_RECORD_ID from generic-templates/cloudflare-ddns/kustomization.yaml and the wildcard from the loop in ddns.py (~line 84). The apex still updates, so WAN changes still propagate; until the fix, every run fails noisily.
  • All 24 names in DNSEndpoint public-dns/public-names, plus apex/www/harbor and the mail-VPS records, resolve. LE uses DNS-01 only, so renewals are unaffected (next: git 11-23).
  • Dead names that now fail to resolve (no backend before either): vm. (stale route vm/vmauth-public-auth), portable.k8s., receiver. (still an active webhook on lab/clusters and safe to delete; receiver.mini is the live one).

Remaining: the ddns fix above, then step 4 (split-horizon).

2026-11-22: the user deleted the Cloudflare wildcard record (step 3). Fallout check: - **Broken: cloudflare-ddns** (mini `ddns-system`). The 21:30Z job failed: it updated the apex, then the PATCH to the wildcard id `1125532a…` returned 404. Fix: drop `WILDCARD_RECORD_ID` from `generic-templates/cloudflare-ddns/kustomization.yaml` and the wildcard from the loop in `ddns.py` (~line 84). The apex still updates, so WAN changes still propagate; until the fix, every run fails noisily. - All 24 names in DNSEndpoint `public-dns/public-names`, plus apex/www/harbor and the mail-VPS records, resolve. LE uses DNS-01 only, so renewals are unaffected (next: git 11-23). - Dead names that now fail to resolve (no backend before either): `vm.` (stale route `vm/vmauth-public-auth`), `portable.k8s.`, `receiver.` (still an active webhook on lab/clusters and safe to delete; `receiver.mini` is the live one). Remaining: the ddns fix above, then step 4 (split-horizon).
Author
Owner

cloudflare-ddns fixed on main in 7f058ab8: apex only, WILDCARD_RECORD_ID removed. A manual run at 21:38Z updated the apex to 70.26.10.82 cleanly. The dead receiver.animeteamspeak.moe webhook (hook 34) on lab/clusters is deleted. Step 3 is done; step 4 (split-horizon) remains.

cloudflare-ddns fixed on main in 7f058ab8: apex only, WILDCARD_RECORD_ID removed. A manual run at 21:38Z updated the apex to 70.26.10.82 cleanly. The dead receiver.animeteamspeak.moe webhook (hook 34) on lab/clusters is deleted. Step 3 is done; step 4 (split-horizon) remains.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/clusters#1708
No description provided.