Adblock with SmartDNS

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3
Author Message
00diabolic
DD-WRT User


Joined: 17 Aug 2011
Posts: 97

PostPosted: Fri Apr 04, 2025 17:27    Post subject: Reply with quote
Alozaros wrote:
ad-dblocking is cats and dogs game...cant always win...

if you search you will find lots of ad-blocking solutions...some better than others.. Cool

egc shared another approach on the post above me... https://github.com/egc112/ddwrt/tree/main/adblock


Yeah I hear that. I love adguard on my phone but do need to disable it on occasion for stuff like fitbit which is annoying (this was before google also).

I found this topic and think im going to use adguard home:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=335497

even if adguard home goes into overkill mode and I have to disable or find pages it blocks and fix it I think this adguard setup seems logical & easy to edit/maintain. The part that confuses me is I use dnsmasq for a bunch of renaming of devices that refuse to give there names on my network LAN list.

I use the MASQUERADE trick to rename devices like this
dhcp-host=71:F5:24:RA:E0:10,Modem,192.168.30.2,set:known

There is discussion on the thread above about keeping dnsmasq, so the question now is can I just keep it on and install that adguardhome without issue?
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 17031
Location: Texas, USA

PostPosted: Fri Apr 04, 2025 18:09    Post subject: Reply with quote
That guide may have problems and AGH is written in golang, which is resource-intensive. I'll be testing it on an XR500 in the coming days and tweaking some possible configuration oops' in the write-up. LOCAL DNS DOES NOT WORK WITH AGH. Also, if your router's DD-WRT image has Privoxy, why do all this crazy mess?
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
00diabolic
DD-WRT User


Joined: 17 Aug 2011
Posts: 97

PostPosted: Fri Apr 04, 2025 19:57    Post subject: Reply with quote
kernel-panic69 wrote:
That guide may have problems and AGH is written in golang, which is resource-intensive. I'll be testing it on an XR500 in the coming days and tweaking some possible configuration oops' in the write-up. LOCAL DNS DOES NOT WORK WITH AGH. Also, if your router's DD-WRT image has Privoxy, why do all this crazy mess?


Ok great question. SO my router does have privoxy but all i ever hear is proxy is slow. Pi-hole seems to be the GOLD standard when it comes to adblocking, so is adguard. So with all the bad press on proxy blocking I decided a long time ago to use host files and DNS blocking. So why do you think privoxy is better? My router is beefy with Broadcom BCM4709 CPU Cores 2 clocked at 1200 MHz. My router an asus ac5300 is good but anything that overheats it causes the 2.4channel to crash and then I am reloading it and that's a pain. So when I head resource intensive and privoxy I run the other way.

Am I wrong?

Your router with 1.7ghz dual core should fair a bit better then mine but still similar, so ill see what your results are and wait to make my switch. My current setup is using DNSmasq with a host file download to tmp directory, its fast mostly and works but I either need to update the host file im using or go in a different direction and that is why I'm looking at all this again. My current setup is configure and forget it with auto update on reboot, which I like. It looks like AGH is also config and forget which is nice.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 17031
Location: Texas, USA

PostPosted: Fri Apr 04, 2025 20:58    Post subject: Reply with quote
I'm curious, do you have any kind of cooling fan involved with your Asus? I've had no issues with Privoxy except recently due to an issue with a dependency change that was resolved after reporting it. There is already a report in the AGH thread of crashing issues, probably due to out-of-memory or some such. Without the user's logs, no idea. We're in full crazy Spring weather here, so I have to exercise some caution on doing anything that will brick routers.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
00diabolic
DD-WRT User


Joined: 17 Aug 2011
Posts: 97

PostPosted: Sat Apr 05, 2025 4:57    Post subject: Reply with quote
kernel-panic69 wrote:
I'm curious, do you have any kind of cooling fan involved with your Asus? I've had no issues with Privoxy except recently due to an issue with a dependency change that was resolved after reporting it. There is already a report in the AGH thread of crashing issues, probably due to out-of-memory or some such. Without the user's logs, no idea. We're in full crazy Spring weather here, so I have to exercise some caution on doing anything that will brick routers.


I do have a cooling fan but it was only needed in the summer. Then I underclocked the CPU to not need it anymore. The underclocking helped a lot.

So you think privoxy would work as good as my current solution? Can I just turn on privoxy and leave my other adblocker via startup script running with DNSmasq or no?
mbellot
DD-WRT User


Joined: 13 Jun 2006
Posts: 82

PostPosted: Mon Oct 20, 2025 18:11    Post subject: Reply with quote
egc wrote:
See: https://github.com/egc112/ddwrt/tree/main/adblock


@egc - I have been using your script for a while now (many thanks!), but I think I found a small issue with it.

On line 137, the sed command that tries to clean up blacklist entries
Code:

# Clean
sed 's/\s*#.*$//; s/^[ \t]*//; s/[ \t]*$//; /^\s*$/d; s/\(^address=\|^server=\|^local=\)//; s/^www.//; s/\///g; \' $RAW_BLACKLIST >> $BLACKLIST


The expression near the end that is supposed to remove "www." from the beginning of an address actually removes www(anything).

This caused some recent headache for me because one of the addresses in the blacklist was www-cloudflare.com which reduced to cloudflare.com, resulting in the entire cloudflare.com domain being blocked. Which in turn prevented cloudflare challenges from working (I visit one website that enforces the check on every visit).

It looks like changing the expression from s/^www.//; to s/^www\.//; (escaping the period) fixed the problem.

Thought I would mention it here since I don't see any way to open an issue for it on your github page.

Also, likely unrelated since I was doing most of the testing on an Ubuntu box, but the final "\" after s/\///g; in the sed command was generating an error - sed: -e expression #1, char 108: unterminated address regex. The resulting final blacklist file only contained the three listed in the script. This doesn't appear to happen on my router (R7000), I get a full blacklist file. On the Ubuntu system removing the backslash eliminated the error.

_________________
WRT54GL modded to 32MB DRAM and 16MB Flash. Very Happy
infra_red_dude
DD-WRT Novice


Joined: 28 Jul 2012
Posts: 7

PostPosted: Sun Dec 21, 2025 1:00    Post subject: Reply with quote
Anybody having issues of late with @egc's script for enabling smartdns adblock? It was working great until recently when all of a sudden it seems to stop on builds r62540 and newer. I uncommented the DEBUG statement but the logs are empty and I see smartdns conf (.adblock) and blacklist domain files on /tmp look to be fine.

DNS resolution works just fine with smartdns, except adblock.

Any pointer on debugging the issue? I use hagezi's Pro Plus block list (https://github.com/hagezi/dns-blocklists)
Goto page Previous  1, 2, 3 Display posts from previous:    Page 3 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum