Adblock ignores dnsmasq instance

I setup two running dnsmasq instances, one running on port 53 - the other runs on port 5553

The processes are running:

31286 dnsmasq   1436 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.dns_lan -k -x /var/run/dnsmasq/dnsmasq.dns_lan.pid
31287 dnsmasq   1428 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.dns_adblock -k -x /var/run/dnsmasq/dnsmasq.dns_adblock.pid

And listening:

udp        0      0 100::1:53               :::*
udp        0      0 100::1:5553             :::*

The dhcp/dnsmasq config:

config dnsmasq 'dns_lan'
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'
        option confdir '/tmp/dnsmasq.d'
        list interface 'lan'
        list interface 'vpn'
        option nonegcache '1'
        option logdhcp '0'
        option quietdhcp '1'

config dnsmasq 'dns_adblock'
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option nonwildcard '1'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        list interface 'lan'
        list interface 'vpn'
        list notinterface 'loopback'
        option localservice '0'
        option port '5553'
        option confdir '/tmp/dnsmasq.d'

I enabled Adblock to use "the second instance" whatever this should be?? I only have named instances :thinking:

The adblock config:

config adblock 'global'
        option adb_debug '0'
        option adb_safesearch '0'
        option adb_dnsfilereset '0'
        option adb_mail '0'
        option adb_backup '1'
        option adb_maxqueue '4'
        option adb_fetchutil 'uclient-fetch'
        option adb_trigger 'lan'
        option adb_report '1'
        option adb_represolve '1'
        option adb_repiface 'br-lan'
        list adb_sources 'adaway'
        list adb_sources 'adguard'
        list adb_sources 'disconnect'
        list adb_sources 'reg_de'
        list adb_sources 'winspy'
        option adb_dns 'dnsmasq'
        option adb_forcedns '0'
        list adb_zonelist 'lan'
        list adb_portlist '5553'
        option adb_replisten '5553'
        option adb_dnsinstance '1'
        option adb_enabled '1'

The result:

Querying dns on port 5553:

root@OpenWrt:/etc/config# host -p 5553 ad.doubleclick.net openwrt.lan
Using domain server:
Name: openwrt.lan
Address: 100::1#5553
Aliases:

Host ad.doubleclick.net not found: 3(NXDOMAIN)

Yezzz! Adblocks active!

Querying dns on port 53:

root@OpenWrt:/etc/config# host -p 53 ad.doubleclick.net openwrt.lan
Using domain server:
Name: openwrt.lan
Address: 100::1#53
Aliases:

Host ad.doubleclick.net not found: 3(NXDOMAIN)

What? Why? Why is adblock now active for every instance??? I ended in deactivating adblock completely

How can i tell adblock to use my instance on port 5553?

Not using AdBlock, and not in front of any openwrt device right now, but check what files it uses on OS level.

I can imagine both instances read the same file.

Yes it is. All the settings in the interface make you believe that a change will cause a change. But selecting the dnsmasq instance just doesn't seem to do anything!

I tried to get rid of

in the instance of 'dns_lan' and removed it, but i made the bill without the landlord...

Stopped dnsmasq, deleted config files in /tmp/etc/dnsmasq.conf.* and restarted dnsmasq... and what do i see?

root@OpenWrt:/tmp/etc# cat dnsmasq.conf.dns_lan | grep conf
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
resolv-file=/tmp/resolv.conf.d/resolv.conf.auto
conf-dir=/tmp/dnsmasq.d
conf-file=/usr/share/dnsmasq/dhcpbogushostname.conf
conf-file=/usr/share/dnsmasq/rfc6761.conf

This is incredibly annoying!

So i added the following option in /etc/config/adblock

 option adb_dnsdir '/tmp/adblock.d'

And after restart of adblock? dnsmasq? (i made many things at the same time!) the following line appeared in /etc/config/dhcp

 option confdir '/tmp/adblock.d'

So i checked again:

root@OpenWrt:/tmp# host -p 5553 ad.doubleclick.net openwrt.lan
Using domain server:
Name: openwrt.lan
Address: 100::1#5553
Aliases:

Host ad.doubleclick.net not found: 3(NXDOMAIN)
root@OpenWrt:/tmp# host -p 53 ad.doubleclick.net openwrt.lan
Using domain server:
Name: openwrt.lan
Address: 100::1#53
Aliases:

ad.doubleclick.net has address 216.58.206.38
root@OpenWrt:/tmp#

Now it works!!!

1 Like

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