Skip to content

Commit e01d036

Browse files
authored
Conditional Forwarding DNS fix (#27)
* Make dnsmasq listen to the container network * Conditional Forwarding for NextDNS * Update nextdns.conf
1 parent 12f7a91 commit e01d036

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

dns-common/on_boot.d/10-dns.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ if [ -n "${IPV6_IP}" ]; then
6969
ip -6 route add ${IPV6_IP}/128 dev br${VLAN}.mac
7070
fi
7171

72+
# Make DNSMasq listen to the container network for split horizon or conditional forwarding
73+
if ! grep -qxF interface=br$VLAN.mac /run/dnsmasq.conf.d/custom.conf; then
74+
echo interface=br$VLAN.mac >> /run/dnsmasq.conf.d/custom.conf
75+
kill -9 `cat /run/dnsmasq.pid`
76+
fi
77+
7278
if podman container exists ${CONTAINER}; then
7379
podman start ${CONTAINER}
7480
else

nextdns/udm-files/nextdns.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@ listen :53
44
report-client-info yes
55
cache-size=10MB
66

7+
# Change this if you changed your subnet, should point to your router, comment out
8+
# if you want to discover via DHCP
9+
discovery-dns 10.0.5.1
10+
11+
# Change and uncomment this if you want to resolve your local ips
12+
# forwarder your.domain=10.0.5.1
13+
14+
# Change and uncomment if you want to resolve ptr records
15+
# bogus-priv false
16+
# forwarder 10.in-addr.arpa=10.0.5.1
717
config YOURIDHERE

0 commit comments

Comments
 (0)