Multiple dnsmac for adblock

I'm having trouble setting up dual dnsmasq instances for use with adblock.
can someone point out my mistake?
dhcp and adblock seem to not work.

config dnsmasq 'Adults_dnsmasq'
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '0'
	option rebind_localhost '1'
	option local '/Adults/'
	option domain 'Adults'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases.adults'
	option resolvfile '/tmp/resolv.conf.auto'
	option confdir '/tmp/dnsmasq.d'
	option nonwildcard '1'
	list interface 'LAN'

config dhcp 'lan'
	option instance 'Adults_dnsmasq
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option force '1'

config dnsmasq 'Kids_dnsmasq'
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '0'
	option rebind_localhost '1'
	option local '/Kids/'
	option domain 'Kids'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases.Kids'
	option resolvfile '/tmp/resolv.conf.Kids'
	option confdir '/tmp/dnsmasq.d'
	option nonwildcard '1'
	list notinterface="loopback"
	list interface 'Lan_Kids'

config dhcp 'Lan_Kids'
	option instance 'Kids_dnsmasq
	option interface 'Lan_Kids'
	option start '100'
	option leasetime '12h'
	option limit '150'
	option force '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

below is my original single dnsmasq instance before I converted to multiple and everything works but no adblock on the Kids_lan:
of note the kids lan is totally wireless in form with a bridged interface made up of two wireless devices with a dhcp range of 192.168.2.100-150.
The adult lan is made up of two seperate wireless networks briged to an eithernet port with a range of 192.168.1.100-150.


config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option localservice '1'
	list addnhosts '/tmp/adb_list.overall'
	option confdir '/tmp/dnsmasq.d'
	option domain 'kids_lan'
	option local '/kids_lan/'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option force '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config dhcp 'LAN_KIDS'
	option start '100'
	option leasetime '12h'
	option limit '150'
	option interface 'LAN_KIDS'
	option force '1'


here is my wireless config:


config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/soc/a000000.wifi'
	option htmode 'HT20'
	option country 'NZ'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'ADMIN_2.5g'
	option key 'XXXXXXXX'
	option encryption 'psk2'

config wifi-device 'radio1'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'platform/soc/a800000.wifi'
	option htmode 'VHT80'
	option country 'NZ'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'ADMIN_5g'
	option key 'XXXXXXXXX'
	option encryption 'psk2'

config wifi-iface 'wifinet2'
	option ssid 'KIDS_2.5g'
	option encryption 'none'
	option device 'radio0'
	option mode 'ap'
	option network 'Lan_kids'
	option disabled '1'

config wifi-iface 'wifinet3'
	option ssid 'KIDS_5G'
	option encryption 'none'
	option device 'radio1'
	option mode 'ap'
	option network 'Lan_kids'
	option disabled '1'
1 Like

how are the kids devices distinguished vs all the others ?

They are on a seperate network interface with their own dhcp pool below is my network config:

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fdf6:0e5c:4f41::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	list dns '8.8.4.4'
	list dns '8.8.8.8'

config interface 'Lan_Kids'
	option proto 'static'
	option type 'bridge'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	list dns '8.8.4.4'
	list dns '8.8.8.8'

config interface 'wan'
	option ifname 'eth1'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth1'
	option proto 'dhcpv6'

I assume the Google DNSes are there because you weren't able to get your own to work?

Wrong syntax here:

Names are case-sensitive, so this is wrong:

Also better not use capital letters, to avoid this kind of problem.

1 Like

I thaught the google DNS was used as wan dns service if it is not on the block list should i leave this blank or set it to 192.168.1.1 and 192.168.2.1 ?

Yes I fixed this now as I named the interface LAN on the network and lan in the wireless config,must remember to rename all instances in all config files.

one omission is I forgot to do this in the firewall config and the reason for the wan side not working thanks for pointing this out.

iI have fixed the notinterface reference now

1 Like

This is the fault I'm getting in my log and the dns is not working unless I force it to 8.8.8.8 in the interface setting and im unsure why:

Tue Dec 22 19:23:26 2020 daemon.info dnsmasq-dhcp[4234]: read /etc/ethers - 0 addresses
Tue Dec 22 19:24:03 2020 daemon.err procd: unable to find /sbin/ujail: No such file or directory (-1)
Tue Dec 22 19:24:14 2020 daemon.info dnsmasq[4234]: exiting on receipt of SIGTERM
Tue Dec 22 19:24:14 2020 user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
Tue Dec 22 19:24:14 2020 user.notice dnsmasq: Allowing 127.0.0.0/8 responses
Tue Dec 22 19:24:15 2020 daemon.err procd: unable to find /sbin/ujail: No such file or directory (-1)
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: started, version 2.80 cachesize 150
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: DNS service limited to local subnets
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID loop-detect inotify dumpfile
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq-dhcp[4758]: DHCP, IP range 192.168.2.100 -- 192.168.2.249, lease time 12h
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq-dhcp[4758]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain test
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain onion
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain localhost
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain local
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain invalid
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain bind
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain Adults_Lan
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: reading /tmp/resolv.conf.auto
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain test
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain onion
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain localhost
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain local
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain invalid
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain bind
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using local addresses only for domain Adults_Lan
Tue Dec 22 19:24:15 2020 daemon.warn dnsmasq[4758]: ignoring nameserver 192.168.1.1 - local interface
Tue Dec 22 19:24:15 2020 daemon.warn dnsmasq[4758]: ignoring nameserver 192.168.1.1 - local interface
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: using nameserver 192.168.1.254#53
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq[4758]: read /etc/hosts - 4 addresses
Tue Dec 22 19:24:15 2020 daemon.err dnsmasq[4758]: failed to load names from /tmp/hosts/dhcp.cfg01411c: Permission denied
Tue Dec 22 19:24:15 2020 daemon.err dnsmasq[4758]: failed to load names from /tmp/adb_list.overall: No such file or directory
Tue Dec 22 19:24:15 2020 daemon.info dnsmasq-dhcp[4758]: read /etc/ethers - 0 addresses

and this is the contents of the dhcp.cfg01411c

# auto-generated config file from /etc/config/dhcp
192.168.1.1 OpenWrt
192.168.2.1 OpenWrt

This setting is obsolete, remove it.
Also check system info and permissions:

ubus call system board; ls -a -l /tmp/hosts /tmp/dnsmasq.d

I was going to ask where the DNSes sit, but it seems they're on the router .... ?

With multiple dnsmac instances the router has access to the internet with opkg and adblock but none of the interfaces will work I get dns activly denied from any downstream device, if i remove the multiple instance it works as normal so i guess there is some sort of bug or firewall issue ?

Does ping work from the clients?

Ping 8.8.8.8, it'll bypass the DNS, and just try to access internet.

Post the configs redacting the private data:

uci show network; uci show wireless; uci show dhcp; uci show firewall

I can ping from my pc to 8.8.8.8 but traceroute fails on any dns lookup
output on Tracert on my PC

Tracing route to 8.8.8.8 over a maximum of 30 hops

  1     2 ms     1 ms     1 ms  OpenWrt.Adults_Lan [192.168.1.1]
  2    <1 ms    <1 ms    <1 ms  192.168.1.254
  3    38 ms    40 ms    39 ms  10.207.224.169
  4     *        *       64 ms  122.56.113.7
  5    55 ms    45 ms    62 ms  122.56.113.4
  6    58 ms    58 ms    75 ms  122.56.119.53
  7    79 ms    95 ms    70 ms  202.50.232.110
  8    67 ms    88 ms    72 ms  202.50.232.246
  9    73 ms    79 ms    82 ms  72.14.217.100
 10    64 ms    81 ms    85 ms  108.170.247.65
 11    84 ms    81 ms    81 ms  142.250.224.221
 12    80 ms    84 ms    77 ms  8.8.8.8

I can run Ping Traceroute and nslookup from the openwrt diagnostics page which work properly.

network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fdf6:0e5c:4f41::/48'
network.Adults_Lan=interface
network.Adults_Lan.type='bridge'
network.Adults_Lan.ifname='eth0'
network.Adults_Lan.proto='static'
network.Adults_Lan.ipaddr='192.168.1.1'
network.Adults_Lan.netmask='255.255.255.0'
network.Adults_Lan.ip6assign='60'
network.Adults_Lan.dns='8.8.8.8' '8.8.4.4'
network.Kids_Lan=interface
network.Kids_Lan.proto='static'
network.Kids_Lan.type='bridge'
network.Kids_Lan.ipaddr='192.168.2.1'
network.Kids_Lan.netmask='255.255.255.0'
network.Kids_Lan.dns='8.8.4.4' '8.8.8.8'
network.Wan=interface
network.Wan.ifname='eth1'
network.Wan.proto='dhcp'
network.Wan6=interface
network.Wan6.ifname='eth1'
network.Wan6.proto='dhcpv6'
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.channel='11'
wireless.radio0.hwmode='11g'
wireless.radio0.path='platform/soc/a000000.wifi'
wireless.radio0.htmode='HT20'
wireless.radio0.country='NZ'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='Adults_2.5g'
wireless.default_radio0.encryption='psk2'
wireless.default_radio0.key='RJzupwjh2011'
wireless.default_radio0.network='Adults_Lan'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.channel='36'
wireless.radio1.hwmode='11a'
wireless.radio1.path='platform/soc/a800000.wifi'
wireless.radio1.htmode='VHT80'
wireless.radio1.country='NZ'
wireless.default_radio1=wifi-iface
wireless.default_radio1.device='radio1'
wireless.default_radio1.mode='ap'
wireless.default_radio1.ssid='Adults_5g'
wireless.default_radio1.encryption='psk2'
wireless.default_radio1.key='RJzupwjh2011'
wireless.default_radio1.network='Adults_Lan'
wireless.wifinet2=wifi-iface
wireless.wifinet2.ssid='Kids_2.5g'
wireless.wifinet2.encryption='none'
wireless.wifinet2.device='radio0'
wireless.wifinet2.mode='ap'
wireless.wifinet2.network='Kids_Lan'
wireless.wifinet3=wifi-iface
wireless.wifinet3.ssid='Kids_5G'
wireless.wifinet3.encryption='none'
wireless.wifinet3.device='radio1'
wireless.wifinet3.mode='ap'
wireless.wifinet3.network='Kids_Lan'
dhcp.Adults_Dns=dnsmasq
dhcp.Adults_Dns.domainneeded='1'
dhcp.Adults_Dns.boguspriv='1'
dhcp.Adults_Dns.filterwin2k='0'
dhcp.Adults_Dns.localise_queries='1'
dhcp.Adults_Dns.rebind_protection='0'
dhcp.Adults_Dns.rebind_localhost='1'
dhcp.Adults_Dns.local='/Adults_Lan/'
dhcp.Adults_Dns.domain='Adults_Lan'
dhcp.Adults_Dns.expandhosts='1'
dhcp.Adults_Dns.nonegcache='0'
dhcp.Adults_Dns.authoritative='1'
dhcp.Adults_Dns.readethers='1'
dhcp.Adults_Dns.leasefile='/tmp/dhcp.leases.Adults_Lan'
dhcp.Adults_Dns.resolvfile='/tmp/resolv.conf.Adults_Lan'
dhcp.Adults_Dns.confdir='/tmp/dnsmasq.d'
dhcp.Adults_Dns.nonwildcard='1'
dhcp.Adults_Dns.interface='Adults_Lan'
dhcp.Kids_Dns=dnsmasq
dhcp.Kids_Dns.domainneeded='1'
dhcp.Kids_Dns.boguspriv='1'
dhcp.Kids_Dns.filterwin2k='0'
dhcp.Kids_Dns.localise_queries='1'
dhcp.Kids_Dns.rebind_protection='0'
dhcp.Kids_Dns.rebind_localhost='1'
dhcp.Kids_Dns.local='/Kids_Lan/'
dhcp.Kids_Dns.domain='Kids_Lan'
dhcp.Kids_Dns.expandhosts='1'
dhcp.Kids_Dns.nonegcache='0'
dhcp.Kids_Dns.authoritative='1'
dhcp.Kids_Dns.readethers='1'
dhcp.Kids_Dns.leasefile='/tmp/dhcp.leases.Kids_Lan'
dhcp.Kids_Dns.resolvfile='/tmp/resolv.conf.Kids_Lan'
dhcp.Kids_Dns.confdir='/tmp/dnsmasq.d'
dhcp.Kids_Dns.nonwildcard='1'
dhcp.Kids_Dns.interface='Kids_Lan'
dhcp.Kids_Dns.notinterface='loopback'
dhcp.Adults_Lan=dhcp
dhcp.Adults_Lan.instance='Adults_Dns'
dhcp.Adults_Lan.interface='Adults_Lan'
dhcp.Adults_Lan.start='100'
dhcp.Adults_Lan.limit='150'
dhcp.Adults_Lan.leasetime='12h'
dhcp.Adults_Lan.force='1'
dhcp.Kids_Lan=dhcp
dhcp.Kids_Lan.instance='Kids_Dns'
dhcp.Kids_Lan.interface='Kids_Lan'
dhcp.Kids_Lan.start='100'
dhcp.Kids_Lan.leasetime='12h'
dhcp.Kids_Lan.limit='150'
dhcp.Kids_Lan.force='1'
dhcp.Wan=dhcp
dhcp.Wan.interface='Wan'
dhcp.Wan.ignore='1'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='0'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'
dhcp.odhcpd.loglevel='4'
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@zone[0]=zone
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[0].network='Adults_Lan'
firewall.@zone[0].name='Adults_Zone'
firewall.@zone[1]=zone
firewall.@zone[1].input='REJECT'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='REJECT'
firewall.@zone[1].masq='1'
firewall.@zone[1].mtu_fix='1'
firewall.@zone[1].network='Wan Wan6'
firewall.@zone[1].name='Wan_Zone'
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='Adults_Zone'
firewall.@forwarding[0].dest='Wan_Zone'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[0].src='Wan_Zone'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[1].src='Wan_Zone'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[2].src='Wan_Zone'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].proto='udp'
firewall.@rule[3].src_ip='fc00::/6'
firewall.@rule[3].dest_ip='fc00::/6'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[3].src='Wan_Zone'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[4].src='Wan_Zone'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[5].src='Wan_Zone'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@rule[6].src='Wan_Zone'
firewall.@rule[7]=rule
firewall.@rule[7].name='Allow-IPSec-ESP'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[7].dest='Adults_Zone'
firewall.@rule[7].src='Wan_Zone'
firewall.@rule[8]=rule
firewall.@rule[8].name='Allow-ISAKMP'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@rule[8].dest='Adults_Zone'
firewall.@rule[8].src='Wan_Zone'
firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'
firewall.@zone[2]=zone
firewall.@zone[2].input='ACCEPT'
firewall.@zone[2].output='ACCEPT'
firewall.@zone[2].forward='ACCEPT'
firewall.@zone[2].network='Kids_Lan'
firewall.@zone[2].name='Kids_Zone'
firewall.@forwarding[1]=forwarding
firewall.@forwarding[1].src='Kids_Zone'
firewall.@forwarding[1].dest='Wan_Zone'
firewall.@rule[9]=rule
firewall.@rule[9].name='Mr_Sparkle_in'
firewall.@rule[9].dest_ip='192.168.1.10'
firewall.@rule[9].target='ACCEPT'
firewall.@rule[9].proto='all'
firewall.@rule[9].src='Kids_Zone'
firewall.@rule[9].dest='Adults_Zone'
firewall.@rule[10]=rule
firewall.@rule[10].proto='all'
firewall.@rule[10].name='Mr_Sparkle_out'
firewall.@rule[10].src_ip='192.168.1.10'
firewall.@rule[10].target='ACCEPT'
firewall.@rule[10].src='Adults_Zone'
firewall.@rule[10].dest='Kids_Zone'
firewall.miniupnpd=include
firewall.miniupnpd.type='script'
firewall.miniupnpd.path='/usr/share/miniupnpd/firewall.include'
firewall.miniupnpd.family='any'
firewall.miniupnpd.reload='1'
firewall.adblock_dns_53=redirect
firewall.adblock_dns_53.name='Adblock DNS, port 53'
firewall.adblock_dns_53.proto='tcp udp'
firewall.adblock_dns_53.src_dport='53'
firewall.adblock_dns_53.dest_port='53'
firewall.adblock_dns_53.target='DNAT'
firewall.adblock_dns_53.src='Kids_Zone'
firewall.adblock_dns_853=redirect
firewall.adblock_dns_853.name='Adblock DNS, port 853'
firewall.adblock_dns_853.proto='tcp udp'
firewall.adblock_dns_853.src_dport='853'
firewall.adblock_dns_853.dest_port='853'
firewall.adblock_dns_853.target='DNAT'
firewall.adblock_dns_853.src='Kids_Zone'
firewall.adblock_dns_5353=redirect
firewall.adblock_dns_5353.name='Adblock DNS, port 5353'
firewall.adblock_dns_5353.proto='tcp udp'
firewall.adblock_dns_5353.src_dport='5353'
firewall.adblock_dns_5353.dest_port='5353'
firewall.adblock_dns_5353.target='DNAT'
firewall.adblock_dns_5353.src='Kids_Zone'
1 Like

Do i have to use a seperate config folder for each dnsmasq instance?

dhcp.Kids_Dns.confdir='/tmp/dnsmasq.d
dhcp.Adults_Dns.confdir='/tmp/dnsmasq.d

like this ?

dhcp.Kids_Dns.confdir='/tmp/dnsmasq.d.Adults
dhcp.Adults_Dns.confdir='/tmp/dnsmasq.d.Adults
uci set dhcp.Adults_Dns.resolvfile="/tmp/resolv.conf.auto"
uci set dhcp.Kids_Dns.resolvfile="/tmp/resolv.conf.auto"
uci commit dhcp
/etc/init.d/dnsmasq restart

uci -q delete network.Adults_Lan.dns
uci -q delete network.Kids_Lan.dns
uci -q delete network.Wan.dns
uci add_list network.Wan.dns="8.8.8.8"
uci add_list network.Wan.dns="8.8.4.4"
uci commit network
/etc/init.d/network restart

It is supposed to be a common directory storing Adblock lists.
So keep it common, unless you need to specify instance-specific settings.

1 Like

That fixed it it all seems to work now.

The weird thing is that it worked with the network config as it was with a single dnsmasq instance.

It suggested to use seperate dns resolv files for each dnsmasq instance as seen here:

[OpenWrt Wiki] DNS and DHCP configuration examples

for INST in lan guest
do
uci set dhcp.${INST}_dns.leasefile="/tmp/dhcp.leases.${INST}"
uci set dhcp.${INST}_dns.resolvfile="/etc/resolv.conf.${INST}"
............. etc...
1 Like

That option is an example of using different upstream resolvers for different dnsmasq instances.
The custom resolver configs should be created by the user.
You don't need it when both instances rely on the same resolvers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.