schmaun / ad-blocker.sh Goto Github PK
View Code? Open in Web Editor NEWScript to block add-banner servers, dns based - https://forum.synology.com/enu/viewtopic.php?f=39&t=78126&p=310721#p310721
Script to block add-banner servers, dns based - https://forum.synology.com/enu/viewtopic.php?f=39&t=78126&p=310721#p310721
This is just a mirror from https://forum.synology.com/enu/viewtopic.php?f=39&t=78126&p=310721#p310721 with my personal config. You will also find a much more newer version there. This repository is not maintained. Or at least very very rare... Below is the original README: ----- Description: The script was developed on DSM 4.3, all the required paths are defined in the beginning. Except for the "null.zone.file" non-transferable master zone manual creation (in the DSM GUI) it doesn't require anything else. Everything (data download/update, zone configuration adjustment and dnsserver config reload) is handled in the script. Lunch it how many times you want. The ad-blocker can be applied to various devices through the views. Zone addition/change (except for the null.zone.file) doesn't corrupt its configuration. I suggest scheduling it once a week. Implementation: DNS-Server config: With the GUI create a new master forward zone Domain type: "Forward Zone" Domain name: "null.zone.file" Serial format: "Date (YYYYMMDDNN)" Enable resolution services (if not already done) Properly setup forwarders (if you wish, you can even control them with views) Console operations: Logon to the nas through telnet/ssh Copy the below script to: /var/packages/DNSServer/target/script/ad-blocker.sh Give it execute permissions chmod +x /var/packages/DNSServer/target/script/ad-blocker.sh Run it and/or schedule it [control panel / task scheduler - user:root (suggested once per week)] sh /var/packages/DNSServer/target/script/ad-blocker.sh Edit: 2014.04.06 Updated the script due to a bug-fix Edit: 2014.10.04 Tested on DSM5.1beta: everything OK Edit: 2015.01.08 I've noted that specially with chrome sometimes the adds keep coming on the pages even if in the network settings only the first dns is configured with the nas ip address. It seems like the browser performs its own resolution with other dns servers regardless of the netwotk settings. Solution: on all the clients (dhcp servers) setup the nas IP as 1st dns server and eventually the router's IP as 2nd dns server (for backup purposes: if the nas is down the router will act as a dns proxy). Then on the router setup a firewall rule for the outgoing traffic on tcp/udp port 53: deny all source IPs except the NAS private lan one.
root@BS58-NAS~ $:./ad-blocker.sh
--2018-03-31 13:29:36-- http://pgl.yoyo.org/as/serverlist.php?hostformat=bindconfig&showintro=0&mimetype=plaintext
Resolving pgl.yoyo.org... 213.230.210.230
Connecting to pgl.yoyo.org|213.230.210.230|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: 'serverlist.php?hostformat=bindconfig&showintro=0&mimetype=plaintext'
[ <=> ] 199,375 1.11MB/s in 0.2s
2018-03-31 13:29:36 (1.11 MB/s) - 'serverlist.php?hostformat=bindconfig&showintro=0&mimetype=plaintext' saved [199375]
root@BS58-NAS~ $:rndc reload
rndc: connection to remote host closed
This may indicate that
Therefore my update task fails.
The named config of synology looks weird and I'm not deep enough into DNS, BIND9 and named to sort this out in due time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.