From 4fe748b071830f4ca707b2a9c3d4c5b143efb7ae Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Jul 2018 20:14:38 +0200 Subject: [PATCH] dns/bind: lost ports, templating, update to dnsbl.ch (#743) --- dns/bind/Makefile | 2 +- .../app/controllers/OPNsense/Bind/forms/general.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Bind/Dnsbl.xml | 8 ++++++-- .../mvc/app/models/OPNsense/Bind/General.xml | 6 +++++- .../src/opnsense/scripts/OPNsense/Bind/dnsbl.sh | 13 +++++++++++-- .../service/conf/actions.d/actions_bind.conf | 7 +++++++ .../service/templates/OPNsense/Bind/+TARGETS | 1 + .../service/templates/OPNsense/Bind/blacklist.db | 13 +++++++++++++ 8 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 dns/bind/src/opnsense/service/templates/OPNsense/Bind/blacklist.db diff --git a/dns/bind/Makefile b/dns/bind/Makefile index cd1fa2efc..6fb266cbf 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 0.3 +PLUGIN_VERSION= 0.4 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind913 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml index b65e56abf..4fe74046b 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml @@ -21,6 +21,12 @@ true Set the IPv6 addresses the service should listen to. + + general.port + + text + Set the port the service should listen to. + general.forwarders diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Dnsbl.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Dnsbl.xml index 609ae42d5..ef128262c 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Dnsbl.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Dnsbl.xml @@ -11,8 +11,12 @@ N Y - ADWare Lists - Malware Lists + AdGuard List + Easy List + Easyprivacy List + Malwaredomain List + NoCoin List + Ransomware Tracker List diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index a2376b78b..8b76d48da 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -1,7 +1,7 @@ //OPNsense/bind/general BIND configuration - 1.0.0 + 1.0.1 0 @@ -19,6 +19,10 @@ Y Y + + 53530 + Y + , N diff --git a/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh b/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh index 9f338fd69..6c9869eef 100755 --- a/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh +++ b/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh @@ -88,13 +88,22 @@ install() { for CAT in $(echo ${1} | tr ',' ' '); do case "${CAT}" in - ad) + ag) + adguard + ;; + el) easylist + ;; + ep) easyprivacy + ;; + nc) nocoin ;; - mw) + rw) rwtracker + ;; + mw) mwdomains ;; esac diff --git a/dns/bind/src/opnsense/service/conf/actions.d/actions_bind.conf b/dns/bind/src/opnsense/service/conf/actions.d/actions_bind.conf index e3b79887c..358a35631 100644 --- a/dns/bind/src/opnsense/service/conf/actions.d/actions_bind.conf +++ b/dns/bind/src/opnsense/service/conf/actions.d/actions_bind.conf @@ -27,3 +27,10 @@ command:/usr/local/opnsense/scripts/OPNsense/Bind/dnsbl.sh parameters: %s type:script message:fetching DNSBLs + +[dnsblcron] +command:/usr/local/opnsense/scripts/OPNsense/Bind/dnsbl.sh;/usr/local/etc/rc.d/named reload +parameters: +type:script +message:fetching DNSBLs and restart +description: Download BIND DNSBLs and restart diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/+TARGETS b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/+TARGETS index 2bc9df277..e9c3be7e8 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/+TARGETS +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/+TARGETS @@ -1,2 +1,3 @@ +blacklist.db:/usr/local/etc/namedb/master/blacklist.db named:/etc/rc.conf.d/named named.conf:/usr/local/etc/namedb/named.conf diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/blacklist.db b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/blacklist.db new file mode 100644 index 000000000..44f0c7c0e --- /dev/null +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/blacklist.db @@ -0,0 +1,13 @@ +$TTL 86400 +@ IN SOA opnsense.localdomain. hostmaster.opnsense.localdomain. ( + 2018072201 + 28800 + 7200 + 864000 + 3600 ) + NS localhost. + NS localhost. + A 127.0.0.1 +@ IN A 127.0.0.1 +* IN A 127.0.0.1 +* IN AAAA ::1