WireGuard clients apply the tunnel DNS to the whole device, so the hub resolver answers lab.internal authoritatively and forwards everything else: - dnsmasq on rpi, bound to lo/wg0/wg-remote only, 10.10.0.1 + 10.20.0.2 - grafana.lab.internal, hubble.lab.internal -> 10.10.0.2 (hosts file, one line per record) - ufw: 53 allowed from 10.10.0.0/24, 10.20.0.0/24, 10.244.0.0/16; dropped everywhere else, inserted above the LAN catch-all - docs: zone, per-client instructions (phone is a linode-hub spoke), rollback
35 lines
1.6 KiB
Text
35 lines
1.6 KiB
Text
# dnsmasq drop-in for the WireGuard-only resolver on rpi (the WG hub).
|
|
# Installed as /etc/dnsmasq.d/lab-internal.conf by install-rpi-dns.sh.
|
|
#
|
|
# WHY: WireGuard clients (Android/iOS especially) apply the tunnel's DNS as the
|
|
# resolver for the WHOLE device while the tunnel is up -- there is no per-domain
|
|
# split on the client. So this server must answer the internal zone itself and
|
|
# FORWARD everything else upstream, otherwise turning it on breaks public DNS.
|
|
#
|
|
# Zone: lab.internal only. Never squat .internal bare or home.arpa.
|
|
|
|
# Authoritative for lab.internal: never forward it upstream, answer from the
|
|
# records below and NXDOMAIN for anything else in the zone.
|
|
local=/lab.internal/
|
|
|
|
# Records live in a plain hosts(5) file -- add a service by adding one line
|
|
# there (infrastructure/networking/internal/dns/lab-internal.hosts).
|
|
addn-hosts=/etc/dnsmasq-lab-internal.hosts
|
|
|
|
# Listen ONLY on loopback and the two WireGuard interfaces. bind-dynamic lets a
|
|
# missing/down WireGuard interface come and go without restarting dnsmasq.
|
|
# The hub's LAN address (192.168.1.125) must NOT serve DNS; ufw enforces that
|
|
# too, but not binding it at all is the first line.
|
|
bind-dynamic
|
|
interface=lo
|
|
interface=wg0
|
|
interface=wg-remote
|
|
|
|
# Forwarding: inherited from /etc/resolv.conf, which on rpi is generated by
|
|
# tailscale (100.100.100.100 = MagicDNS, which forwards to the DHCP resolvers).
|
|
# Do not hardcode a public resolver here.
|
|
|
|
# Don't forward single-label names or reverse-lookups for RFC1918 we own; keeps
|
|
# LAN/mDNS noise off the upstream and out of the public root.
|
|
domain-needed
|
|
bogus-priv
|