0

2019-04-19: I've come to the conclusion this might be some setting or bug in dnsmasq as logs shows config error is REFUSED. I will update this question at sometime in the future after I've analyzed the source code.


Ad-blocking is done through 'dnsmasq' which reads a hosts file, when logged into the OpenWrt device blocking works as expected:

PING s0.2mdn.net (0.0.0.0): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.268 ms
...

However on a computer that is connected to the OpenWrt router (wired or wireless) blocking does not work.

danielsokolowski@DANDC-OFFICE:~$ ping s0.2mdn.net

Pinging s0-2mdn-net.l.google.com [172.217.1.166] with 32 bytes of data:
Reply from 172.217.1.166: bytes=32 time=22ms TTL=56
..

Some info :


root@481:~# cat /etc/resolv.conf
search lan
nameserver 127.0.0.1

root@481:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
10.4.81.0       *               255.255.255.0   U     0      0        0 br-lan
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0

root@481:~# netstat -lp | grep dnsmasq
tcp        0      0 192.168.0.103:domain    0.0.0.0:*               LISTEN      1890/dnsmasq
tcp        0      0 localhost:domain        0.0.0.0:*               LISTEN      1890/dnsmasq
tcp        0      0 481.lan:domain          0.0.0.0:*               LISTEN      1890/dnsmasq
...
tcp        0      0 localhost:domain        :::*                    LISTEN      1890/dnsmasq
...
udp        0      0 192.168.0.103:domain    0.0.0.0:*                           1890/dnsmasq
udp        0      0 localhost:domain        0.0.0.0:*                           1890/dnsmasq
udp        0      0 481.lan:domain          0.0.0.0:*                           1890/dnsmasq
udp        0      0 0.0.0.0:bootps          0.0.0.0:*                           1890/dnsmasq
...
root@481:~#

danielsokolowski@DANDC-OFFICE:~$ ipconfig

Windows IP Configuration


...

Ethernet adapter Local Area Connection 2:

   Connection-specific DNS Suffix  . : lan
   Link-local IPv6 Address . . . . . : fe80::d940:8d32:8ecf:38b5%13
   IPv4 Address. . . . . . . . . . . : 10.4.81.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.4.81.1

...

danielsokolowski@DANDC-OFFICE:~$ ping s0.2mdn.net

Pinging s0-2mdn-net.l.google.com [172.217.164.230] with 32 bytes of data:
Reply from 172.217.164.230: bytes=32 time=17ms TTL=56
Reply from 172.217.164.230: bytes=32 time=29ms TTL=56
4
  • @roaima I'm sorry I can't test the wired setup any more....I've updated the question. – Daniel Sokolowski Mar 31 '19 at 20:33
  • dnsmasq is on the router, see updated answer. – Daniel Sokolowski Mar 31 '19 at 20:54
  • 1
    So, it's effectively DNS-based ad-blocking, and so the clients would have to be configured to use the router's DNS service in order to take advantage of the ad-blocking. Check which DNS nameserver(s) the WiFi clients are actually using. – telcoM Apr 1 '19 at 9:04
  • @telcoM yes but that's the wierd thing, the clients are pointed at my router's DNS, see updated answer, hmm thinking now out loud here I'm thinking it's due to different subnets. – Daniel Sokolowski Apr 3 '19 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.