Cleaned up the original script some (better tabs, removed not needed and added example to remove stuff from the list.
# Script to download adblock list
# https://www.micu.eu/adblock/adblock.php
#
:log warning "starting adblock update"
:delay 2
:log warning "downloading adblock"
:local hostScriptUrl "https://www.micu.eu/adblock/adblock.php"
:local scriptName "adblock"
do {
/tool fetch mode=http url=$hostScriptUrl dst-path=("./".$scriptName)
:delay 20
:if ([:len [/file find name=$scriptName]] > 0) do={
:log warning "removing old adblock list"
/ip dns static remove [find address=127.0.0.1]
:log warning "importing new adblock list"
/import file-name=$scriptName
/file remove $scriptName
:log warning "adblock list imported"
} else={
:log warning "adblock list not downloaded, script stopped"
}
} on-error={
:log warning "adblock list download FAILED"
}
# These I would like to white list
ip dns static remove [find where name="aarki.com"]
ip dns static remove [find where name="www.google.com"]
# To remove list complete, use this command:
# /ip dns static remove [find address=127.0.0.1]
Script do download from internet a list of around 17000 DNS pointers that are added to your router.
Example this list likes to block CNN, it will add your your router www.cnn.com with an ip of 127.0.0.1
So if you do visit at site that like to open at 3rd party url to www.cnn.com, it will not reach it.
This is just a huge list of DNS that are used by advertising company that your will then block.
Static DNS on the Tik can act like a hosts file does under a PC OS.
Tiks with low memory will have issues loading this type of list so if one has tiks like hEX memory can be exhausted quickly.
I have no problem with this list with 17000 DNS host on my hEX
At the same time I have a fw rule that block all IP that tries any blocked port on my router for 24 hour. This list has between 7000 and 15000 IP at the same time as the DNS block list.
What did eat my memory is the DoH that has a memory bug, so disabled at the moment.
PS also have configuration like a medium large company with VPN, 30+ filter, 15+ NAT rules +++ and running fine.