AdBlock

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2, 3
Author Message
mondc10
DD-WRT Novice


Joined: 28 Mar 2018
Posts: 10

PostPosted: Tue Jan 15, 2019 22:07    Post subject: Reply with quote
Thanks a lot again for helping us technically challenged, appreciate the help!
Sponsor
rotation
DD-WRT User


Joined: 13 Dec 2012
Posts: 54

PostPosted: Sun Jun 02, 2019 7:38    Post subject: Reply with quote
Alozaros wrote:
well fairly this script is not working for my 1043nd v2
it says connecting to...
Updating adblocker FAILED!
witch lead me to the clue either curl is not working or something else, i just cant find where it dl the stuff


im still using this old script and its working ok

_rogue=0.0.0.0
echo -e "n=1\nwhile ! wget -q -O /tmp/hsts http://sbc.io/hosts/hosts ; do\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\n\tsleep 60\ndone\ngrep \"^0.0.0.0\" /tmp/hsts | grep \"^0.0.0.0\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >/tmp/dlhosts\nrm /tmp/hsts\nkillall -HUP dnsmasq" >/tmp/wh
sh /tmp/wh &

add those to additional DNSmasq options

addn-hosts=/tmp/dlhosts

and to cron

0 12 * * * root /tmp/.rc_startup

or you can use
0 12 * * * root /tmp/custom.sh

and move the script to custom



Hello all,

what is the difference in using this method vs. using a pihole as DNS server? PiHole would be better to configure, as new lists can be added easily, are there other differences? Is the method used the same - DNS blocking on both?
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6436
Location: UK, London, just across the river..

PostPosted: Sun Jun 02, 2019 10:07    Post subject: Reply with quote
hmmm i don't have a pi but i do use an this ad-block script as long as it does the job, on pi you might have better options for it, also there are some other ad-blocking scripts for ddwrt routers that are more advanced...
as far efficiency is concerned, those are host lists based scripts...blocking works only if you use the local DNS, if you use unbound, DoH or DoT it wont work i guess...
so if you can do it on Pi hole instead you may be more efficient...the other question is if this will hit speed performance instead...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
dareino
DD-WRT User


Joined: 06 Apr 2018
Posts: 70

PostPosted: Sun Jun 02, 2019 16:15    Post subject: Reply with quote
I use this script above running as a cron job. What I like about this host file, its a collection of multiple host files from various contributors with Steven Black Host file leading the way.
https://github.com/StevenBlack/hosts
its currently blocking 39k addresses..

d
dmcourtn
DD-WRT Novice


Joined: 21 Jun 2020
Posts: 2

PostPosted: Sun Jun 21, 2020 2:52    Post subject: Sort command broken Reply with quote
Xeon2k8 wrote:

curl -k https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts |
grep 0.0.0.0 |
sed 's/[[:space:]]*#.*$//g;' | sed 's/0.0.0.0/0.0.0.0/g' |
grep -v localhost | tr ' ' '\t' |
tr -s '\t' | tr -d '\015' | sort -u >/tmp/hosts1



This script has been running fine for me for six months now.

I just upgraded my router to v3.0-r43420 std (06/15/20)

Now, that command line fails. I get the error "Illegal instruction".

I've run that single line pipe by pipe, and it doesn't fail until the "sort -u >/tmp/hosts1" command.

I removed the "sort -u" and sent the output up until then directly to hosts1. That script runs. But the hosts0 file is significantly larger because of duplicates.

Thoughts?
Xeon2k8
DD-WRT Guru


Joined: 11 Feb 2016
Posts: 1288

PostPosted: Sun Jun 21, 2020 8:35    Post subject: Re: Sort command broken Reply with quote
dmcourtn wrote:
Xeon2k8 wrote:

curl -k https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts |
grep 0.0.0.0 |
sed 's/[[:space:]]*#.*$//g;' | sed 's/0.0.0.0/0.0.0.0/g' |
grep -v localhost | tr ' ' '\t' |
tr -s '\t' | tr -d '\015' | sort -u >/tmp/hosts1



This script has been running fine for me for six months now.

I just upgraded my router to v3.0-r43420 std (06/15/20)

Now, that command line fails. I get the error "Illegal instruction".

I've run that single line pipe by pipe, and it doesn't fail until the "sort -u >/tmp/hosts1" command.

I removed the "sort -u" and sent the output up until then directly to hosts1. That script runs. But the hosts0 file is significantly larger because of duplicates.

Thoughts?

That hosts file has no duplicates so not sure which url/s you are curling. Replace the sort with:
Code:
curl -k https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts |
      grep 0.0.0.0 |
      sed 's/[[:space:]]*#.*$//g;' | sed 's/0.0.0.0/0.0.0.0/g' |
      grep -v localhost | tr ' ' '\t' |
      tr -s '\t' | tr -d '\015' | awk '!seen[$0]++' >/tmp/hosts1

The sort fails because the file is too large

_________________
R6400v2 (boardID:30) - Kong 36480 running since 03/09/18 - (AP - DNSMasq - AdBlocking - QoS)
R7800 - BS 31924 running since 05/26/17 - (AP - OpenVPN Client - DNSMasq - AdBlocking - QoS)
R7000 - BS 30771 running since 12/16/16 - (AP - NAS - FTP - SMB - OpenVPN Server - Transmission - DDNS - DNSMasq - AdBlocking - QoS)
R6250 - BS 29193 running since 03/20/16 - (AP - NAS - FTP - SMB - DNSMasq - AdBlocking)
dmcourtn
DD-WRT Novice


Joined: 21 Jun 2020
Posts: 2

PostPosted: Sat Jun 27, 2020 5:07    Post subject: Re: Sort command broken Reply with quote
Xeon2k8 wrote:

Replace the sort with:
Code:
curl -k https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts |
      grep 0.0.0.0 |
      sed 's/[[:space:]]*#.*$//g;' | sed 's/0.0.0.0/0.0.0.0/g' |
      grep -v localhost | tr ' ' '\t' |
      tr -s '\t' | tr -d '\015' | awk '!seen[$0]++' >/tmp/hosts1

The sort fails because the file is too large


Thank you so much. That worked like a champ.
Goto page Previous  1, 2, 3 Display posts from previous:    Page 3 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware 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