headscale: derive tailnet DNS records from dns-updater list #544
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "headscale-extra-records"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the abandoned #542 (which tried subnet routing and broke the LAN). Goal is still the same: let tailnet clients (notably phones on cellular using beefcake as exit node) reach internal services like
git.lyte.dev.Approach: instead of advertising the LAN subnet over tailscale, have headscale's MagicDNS return beefcake's tailnet IP for those hostnames via
extra_records. Tailnet clients get100.64.0.2, reach beefcake directly through the existing ACL, no subnet route involved. LAN clients still query the router's dnsmasq and get192.168.0.9as before.Single source of truth:
lyte.dns-updater.recordsalready lists every subdomain beefcake serves onlyte.dev(those records get registered with the public DNS server via nsupdate). The headscale module derivesextra_recordsfrom the same list — no second registry to keep in sync.Wildcards like
*.vpn.hare filtered out sinceextra_recordsonly supports exact names.Why not the subnet-route approach (closed #542)
Advertising
192.168.0.0/24from beefcake, combined with beefcake also running--accept-routes, caused beefcake's own tailscaled to install the route back viatailscale0, blackholing its own LAN. DNS resolution failed (router unreachable), MagicDNS fell through to1.1.1.1which returned the public IP, then nothing could hairpin →git.lyte.devwas down for every host on the network. Rolled back live.This approach has none of those failure modes since nothing reroutes — it's purely a DNS-layer answer.
Test plan
nixos-rebuild switch).sudo headscale policy get(or checkservices.headscale.settings.dns.extra_recordsrendered into config).dig git.lyte.devshould return100.64.0.2(tailnet IP), not192.168.0.9(LAN).dig git.lyte.devshould still return192.168.0.9.https://git.lyte.dev/loads.https://git.lyte.dev/still loads (because the route via beefcake's tailnet IP doesn't require exit-node).paperless.h.lyte.devalso works the same way from tailnet.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.