Adblock for DD-WRT (version 2)

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2, 3 ... 21, 22, 23
Author Message
Ostddwrt
DD-WRT Novice


Joined: 31 Aug 2018
Posts: 18
Location: FL

PostPosted: Fri Aug 05, 2022 3:36    Post subject: Reply with quote
Hi 05dyna, you mean you installed pi-hole on the router?...

Can you elaborate on this? Confused

I'm using a simple hosts file on each DT at home, but considering the broader and better approach of scripts on my router (over 500 MB RAM WRT3200ACM) with dnsmasq, or pi-hole?...

Which one is less of hassle?... Question

Thanks a lot for any heads up.

Ost

_________________
DD-WRT V3.0-r49626 std (08/03/22) on WRT3200ACM and flying...
Sponsor
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Fri Jan 19, 2024 18:57    Post subject: One line script Reply with quote
One line script
1. Waits for internet connection. 2. Downloads host file. 3. Restarts DNSMasq (loads hosts)
(Replace "/jffs/hosts" with your own custom path and the host file server if you want)

Add to ADMINISTRATION / Commands / Startup
Code:
until [ `nvram get wan_ipaddr` != 0.0.0.0 ]; do sleep 1; done; wget -O /jffs/hosts http://sbc.io/hosts/hosts; killall -HUP dnsmasq


Also add to SERVICES / Services / DNSMasq / Additional DNSMasq Options
Code:
addn-hosts=/jffs/hosts


Last edited by Veole on Sat Jan 20, 2024 17:35; edited 4 times in total
Alozaros
DD-WRT Guru


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

PostPosted: Sat Jan 20, 2024 11:30    Post subject: Reply with quote
"wget -O /jffs/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts; killall -HUP dnsmasq" for that bit you'd need curl Laughing
_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 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 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 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
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Jan 20, 2024 12:42    Post subject: Reply with quote
Or use http.
_________________
"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...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Sat Jan 20, 2024 13:40    Post subject: Reply with quote
Alozaros wrote:
"wget -O /jffs/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts; killall -HUP dnsmasq" for that bit you'd need curl Laughing


Both wget and curl work fine with https. wget can't verify https certificates like curl but downloads files the same. I tested both and decided to post the one line script with wget because I think curl is not included in busybox by default, but wget is always present.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Sat Jan 20, 2024 14:11    Post subject: Reply with quote
I have no idea why you would say that.
The integrated wget busybox version does not support ssl

Rolling Eyes

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Sat Jan 20, 2024 14:24    Post subject: Reply with quote
ho1Aetoo wrote:
I have no idea why you would say that.
The integrated wget busybox version does not support ssl

Rolling Eyes


Because I've tested both wget and curl and I'm currently using wget. It works. I always deleted the host file before testing, just in case.

Code:
root@router:/jffs# until [ `nvram get wan_ipaddr` != 0.0.0.0 ]; do sleep 1; done
; busybox wget -O /jffs/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master
/hosts; killall -HUP dnsmasq
Connecting to raw.githubusercontent.com (185.199.109.133:443)
wget: note: TLS certificate validation not implemented
saving to '/jffs/hosts'
hosts                100% |********************************| 4576k  0:00:00 ETA
'/jffs/hosts' saved


Code:
root@router:/jffs# until [ `nvram get wan_ipaddr` != 0.0.0.0 ]; do sleep 1; done
; curl -o /jffs/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master
/hosts; killall -HUP dnsmasq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4576k  100 4576k    0     0   364k      0  0:00:12  0:00:12 --:--:--  355k
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Sat Jan 20, 2024 14:32    Post subject: Reply with quote
r53339

root@DD-WRT:/tmp# wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Connecting to raw.githubusercontent.com (185.199.108.133:443)
wget: error getting response: Connection reset by peer
root@DD-WRT:/tmp#

r52369

root@DD-WRT:/tmp# wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Connecting to raw.githubusercontent.com (185.199.108.133:443)
wget: error getting response: Connection reset by peer

r50906

root@DD-WRT:/tmp# wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Connecting to raw.githubusercontent.com (185.199.108.133:443)
wget: error getting response: Connection reset by peer

does not work on any of my devices

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Sat Jan 20, 2024 14:42    Post subject: Reply with quote
It seems wget functionality was removed in newer ddwrt builds. But why?

I even tested it in busybox Windows and it works like curl (without any connection error or TLS certificate validation error).
600K exe -> https://frippery.org/files/busybox/busybox.exe
Code:
C:/ $ wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Connecting to raw.githubusercontent.com (185.199.110.133:443)
saving to 'hosts'
hosts                100% |***************************************************************************************************************| 4576k  0:00:00 ETA 'hosts' saved


https://www.gnu.org/software/wget/
Quote:
GNU Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS, the most widely used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.
itwontbewe
DD-WRT User


Joined: 29 Sep 2020
Posts: 260
Location: United States

PostPosted: Sat Jan 20, 2024 15:41    Post subject: Reply with quote
http link
http://sbc.io/hosts/hosts
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Sat Jan 20, 2024 18:54    Post subject: Reply with quote
Busybox wget has never had https/ssl functionality in DD-WRT, or hasn't for a long time.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Wed Jan 24, 2024 17:47    Post subject: Reply with quote
What is the best way to restart dnsmasq to reload the host file?

Wouldn't be cleaner to use "service" commands instead of kill?

Code:
stopservice -f dnsmasq; startservice -f dnsmasq

vs
Code:
killall -HUP dnsmasq
Alozaros
DD-WRT Guru


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

PostPosted: Thu Jan 25, 2024 5:18    Post subject: Reply with quote
killall -HUP dnsmasq should do ...
_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 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 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 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
Goto page Previous  1, 2, 3 ... 21, 22, 23 Display posts from previous:    Page 23 of 23
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum