AdBlock is a minimalist router-based ad blocking script for routers with very limited RAM. It uses the DNS poisoning technique combined with publically available blocklists to re-route all blacklisted domains to a pixelserv client (a tiny one-pixel transparent gif webserver) running on your router. This script, pixelserv, plus the two block lists that it downloads requires a total of about 600 KB.
Your router will need a JFFS partition, SSH access and the ability to set cron jobs, so you will most likely need an aftermarket router firmware such as DD-WRT or Tomato.
- Create a JFFS partition via your router's admin interface.
- Clone this repo.
cd && mkdir adblock && git clone https://github.com/kidquick/AdBlock adblock
- Grant execute rights to the script.
chmod +x ~/adblock/adblock.sh
- SSH all files to your JFFS partition.
scp ~/adblock/* admin@router:/jffs/dns
- Add the script to router's startup commands (via the router admin GUI).
- Reboot the router.
- Done!
Blocklists are automatically updated every Monday at 4am. To force an update, run the script with a -f switch.
./adblock.sh -f