Git Product home page Git Product logo

ad-blocker.sh's Introduction

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.

ad-blocker.sh's People

Contributors

janchristiansen avatar schmaun avatar

Stargazers

Icorson avatar Christopher Zenzel avatar Benjamin Brisson avatar

Watchers

 avatar James Cloos avatar

ad-blocker.sh's Issues

rndc reload stopped working after last DSM update

Since th last DSM update to DSM 6.1.6-15266 rnd reload bring an error:

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]

Eigene blacklist angefügt
rndc: neither //etc/rndc.conf nor /var/packages/DNSServer/target/named/rndc.key was found

Also a "rndc reload" from root brings this:

root@BS58-NAS~ $:rndc reload
rndc: connection to remote host closed
This may indicate that

  • the remote server is using an older version of the command protocol,
  • this host is not authorized to connect,
  • the clocks are not synchronized, or
  • the key is invalid.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.