[HowTo] Running Adguard Home on OpenWrt

Was this a custom blocklist of your own, or a generally available one? If the latter, it'd be helpful if you posted the URL, both so people can avoid it and the developers can look at it and zero in on the problem. If it's custom, can you upload it either here or somewhere like github so developers and self-selected users can take a look at it? Even as crude an approach as a binary search might isolate the problem without having to trace through code.

It was this one: https://dbl.oisd.nl/
It’s the full list for network based dns blockers on https://oisd.nl/

It’s updated so the problem is fixed.

1 Like

For AdGuardHome you must use abp.oisd.nl, not dbl.oisd.nl.

Not according to https://oisd.nl/how2use.

Think you might not be reading the right section:

AdGuardHome supports basic Adblock rules and hosts files syntax:

Like so:

root@OpenWrt:/mnt/sda1/AdGuardHome/data/filters# head -30 1.txt 
!
! Title: AdGuard DNS filter
! Description: Filter composed of several other filters (AdGuard Base filter, Social media filter, Tracking Protection filter, Mobile ads filter, EasyList, EasyPrivacy, etc) and simplified specifically to be better compatible with DNS-level ad blocking.
! Homepage: https://github.com/AdguardTeam/AdguardSDNSFilter
! License: https://github.com/AdguardTeam/AdguardSDNSFilter/blob/master/LICENSE
! Last modified: 2021-12-04T12:07:39.096Z
!
! Compiled by @adguard/hostlist-compiler v1.0.12
!
!
! Source name: AdGuard Base filter ad servers
! Source: https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/EnglishFilter/sections/adservers.txt
!
!
! Section contains list of advertising networks
!
! The rules with hints are at the end of file
!
||eputfeable.co^
||ngecauuks.co^
||gobiidinshore.com^
||escudotagalog.com^
||courierregistered.com^
||new-pressroom.com^
||madehimn.xyz^
||srsihavelearn.xyz^
||yestedjgrs.xyz^
||maritaltrousersidle.com^
||wearetopple.com^
||d1t4ekjh9ps4ob.cloudfront.net^

root@OpenWrt:/mnt/sda1/AdGuardHome/data/filters# head -30 2.txt 
# AdAway default blocklist
# Blocking mobile ad providers and some analytics providers
#
# Project home page:
# https://github.com/AdAway/adaway.github.io/
#
# Fetch the latest version of this file:
# https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt
#
# License:
# CC Attribution 3.0 (http://creativecommons.org/licenses/by/3.0/)
#
# Contributions by:
# Kicelo, Dominik Schuermann.
# Further changes and contributors maintained in the commit history at
# https://github.com/AdAway/adaway.github.io/commits/master
#
# Contribute:
# Create an issue at https://github.com/AdAway/adaway.github.io/issues
#

127.0.0.1  localhost
::1  localhost

# [163.com]
127.0.0.1 analytics.163.com
127.0.0.1 crash.163.com
127.0.0.1 crashlytics.163.com
127.0.0.1 iad.g.163.com

root@OpenWrt:/mnt/sda1/AdGuardHome/data/filters# head -30 5.txt 
#    __ __ ____ ____                 
#   /  (  / ___(    \
#  (  O )(\___ \) D (
#   \__(__(____(____/
#
#  Title: oisd full      
#  Syntax: dbl       
#  Entries: 1039441
#  TimeUpdated: 2021-12-04T15:01:26+01:00     
#  Maintainer: sjhgvr
#  Expires: 1 day (update frequency)
#  Homepage: https://oisd.nl

0-0-0-0-0-0-0-0-0-0-0-0-0-10-0-0-0-0-0-0-0-0-0-0-0-0-0.info
0-0-0-0-0-0-0-0-0-0-0-0-0-18-0-0-0-0-0-0-0-0-0-0-0-0-0.info
0-0-0-0-0-0-0-0-0-0-0-0-0-33-0-0-0-0-0-0-0-0-0-0-0-0-0.info
0-0.fr
00000000-0000-0000-0000-8c89a56da7f2.cdn.adx1.com
00000000-0000-0000-0000-ac1f6b9bc102.cdn.adx1.com
0-07.ru
0-1-2.vicp.cc
0-2u.com
00-4-008001-07-04.nrb.footprintdns.com
0-29.com
0-100-pool.coinlab.biz
0-100.coinlab.biz
0-100pool.coinlab.biz
0-132.net.daraz.com
000-638-practice-test-exam-questions.apponic.com
0-day.us

My understanding is that abp.oisd.nl is optimized for AdGuardHome and consumes less RAM.

I haven’t noticed a RAM issue, I also haven’t seen a particular reason when to use which syntax, since AGH supports both. I did find a response in a topic however from the creator of oisd.nl and there he states that for AGH you’re better of using abp instead of dbl. I didn’t know that until now so I’m going to switch to the abp variant. Thank you for telling me that.

--EDIT--
replaced dbl with abp, smaller file size on disk and slightly more free memory :+1:

1 Like

Just of of interest, how many rules are in that list? at 93mb it has to be rather considerable.

One of the reasons i use the lists i do is down to memory. While big lists have their place, we have to bear in mind that what we are doing here is adding AGH to OpenWrt routers. This usually means limitations on disk space and memory, especially for older routers. OpenWrt already has depreciated 4 and 8mb routers. I'm running a 128mb BT Hub 5. I can get about 140k of filter rules before i run into memory issues. The bigger problem is the disk space and AGH binary being 35mb alone. Its why i created my script to do updates and filed an issue on AGH's hub. https://github.com/AdguardTeam/AdGuardHome/issues/3801

You can always add more filters if your hardware is powerful enough. But just remember about smaller less powerful routers too. :slight_smile:

(edit - For those wondering whats coming next in AGH - https://github.com/AdguardTeam/AdGuardHome/milestone/37 )

https://github.com/AdguardTeam/AdGuardHome/issues/2830 is potentially the bit we have been waiting for to have AGH take over DHCP from OpenWrt.

Give or take a few lines in the header:

cat 5.txt | wc -l
3743454

I'm running it on a R7800 with a NSS capable build, so both CPU's are pretty much at the disposal of services like AGH.

I've replaced the dbl variant with the abp variant of the blocklist that is smaller in size (about 6.5MB) and seems more efficient due to syntax (I assume):

cat 5.txt | wc -l
309247
1 Like

3.7million? Fark me...

Yeah. ok. Now i know why it 90+mb. Thats a hell of a block list.

There was a thread i read (i think it was on the pihole reddit) about the merits of massive blocking vs more targeted blocking. I guess really its down to the resources you have available vs filters. Still I do wonder on the effectiveness vs overblocking once you get towards 1+ million filters. (I primarily target adservers and known malware. I do understand that parental blocking will quickly bump things up as well.)

Looking at the memory usage the last 24hrs, I don't see much difference so I guess AGH is pretty efficient. I replaced the dbl with abp about 6hours ago from these RRD's:




I like the R7800 a lot and from what I see on this forum I'm not the only one, for good reason; it's a very capable WiFi5 unit for a reasonable price on used items.

And I do parental blocking as well. Before I used AGH, I used the Adblock service in OpenWRT and selected about 6 or 8 different blocklists, simply to catch the most amount of blocking as possible without overdoing it. Perhaps I overshot that and still over done that :sweat_smile:

But my R7800 served that amount of lines with Adblock without complaining. I guess with this abp.oisd.nl list I get a nice curated list that serves me well?

I have my blocklist disabled cos I'm using NextDNS Premium as my upstream servers. My AGH still consumed all available memory and had to be restarted after 4 days.

Right now, I just set a cron job to auto restart AdGuardHome every 4am.

Current Edge build Version: v0.107.0-a.218+90e65b66

That's curious. Wonder what's causing that. May be worth some investigation and file an issue?

(edit - Seems you arent the only one. https://github.com/AdguardTeam/AdGuardHome/issues/3913)

You disabled logging? You can disable stats and logging via the settings page but there are these settings.

These are in the yaml file.

Log settings

log_file — Path to the log file. If empty, writes to stdout, if syslog -- system log (or eventlog on Windows).
log_compress — Compress determines if the rotated log files should be compressed using gzip (default: false)
log_localtime — If the time used for formatting the timestamps in is the computer's local time (default: false [UTC])
log_max_backups — Maximum number of old log files to retain (MaxAge may still cause them to get deleted) (default: 0, which retains all old log files)
log_max_size — Maximum size in megabytes of the log file before it gets rotated (default: 100 MB)
log_max_age — MaxAge is the maximum number of days to retain old log files (default: 3)
verbose — Enable our disables debug verbose output (default: false)

How can you get to run AGH + Nextdns together without interfering with Internet connection? I can run only one at a time

Said it uses NextDNS as upstream servers.

He uses AGH as a "client" which then uses AGH as upstream due to NextDNS not having a proper client.

Ok, I have finally sat down and reinstalled AGH on a backup router from scratch and re-written a fair chunk of posts from here into a new updated guide.

Might be time to let this thread archive out naturally now as it is 2yrs old and while some of the thread is still relevant, certainly earlier posts are no longer needed.

https://adguard-dns.com/en/welcome.html

So after writing up my new install post earlier today I ran across this.

I am unsure if this will be their new AGH update or maybe a different client. Certainly is going to be worth keeping an eye on. Much better interface and statistics by the look of things.

1 Like

Disable Adguard filtering. Basically you route all traffic to NextDNS with the exception that u use optimistic caching on adguard

1 Like