From 1f82b5c2c4011c3bb8ea0f5273c46ca1a5bb55e2 Mon Sep 17 00:00:00 2001 From: John D <427295+boostchicken@users.noreply.github.com> Date: Sat, 25 Jul 2020 01:14:31 -0700 Subject: [PATCH] Conditional Forwarding DNS fix (#27) * Make dnsmasq listen to the container network * Conditional Forwarding for NextDNS * Update nextdns.conf --- dns-common/on_boot.d/10-dns.sh | 6 ++++++ nextdns/udm-files/nextdns.conf | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/dns-common/on_boot.d/10-dns.sh b/dns-common/on_boot.d/10-dns.sh index a0b9494..fcc6e09 100644 --- a/dns-common/on_boot.d/10-dns.sh +++ b/dns-common/on_boot.d/10-dns.sh @@ -69,6 +69,12 @@ if [ -n "${IPV6_IP}" ]; then ip -6 route add ${IPV6_IP}/128 dev br${VLAN}.mac fi +# Make DNSMasq listen to the container network for split horizon or conditional forwarding +if ! grep -qxF interface=br$VLAN.mac /run/dnsmasq.conf.d/custom.conf; then + echo interface=br$VLAN.mac >> /run/dnsmasq.conf.d/custom.conf + kill -9 `cat /run/dnsmasq.pid` +fi + if podman container exists ${CONTAINER}; then podman start ${CONTAINER} else diff --git a/nextdns/udm-files/nextdns.conf b/nextdns/udm-files/nextdns.conf index 5a19613..d56f5e1 100644 --- a/nextdns/udm-files/nextdns.conf +++ b/nextdns/udm-files/nextdns.conf @@ -4,4 +4,14 @@ listen :53 report-client-info yes cache-size=10MB +# Change this if you changed your subnet, should point to your router, comment out +# if you want to discover via DHCP +discovery-dns 10.0.5.1 + +# Change and uncomment this if you want to resolve your local ips +# forwarder your.domain=10.0.5.1 + +# Change and uncomment if you want to resolve ptr records +# bogus-priv false +# forwarder 10.in-addr.arpa=10.0.5.1 config YOURIDHERE