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
|