dns/bind: Add duck duck go (#1085)

This commit is contained in:
Northguy
2018-12-23 18:43:05 +01:00
committed by Franco Fichtner
parent fd48304ea4
commit 5d6101327f
5 changed files with 29 additions and 1 deletions
@@ -25,6 +25,12 @@
<type>checkbox</type>
<help>This will force SafeSearch.</help>
</field>
<field>
<id>dnsbl.forcesafeduckduckgo</id>
<label>Enable DuckDuckGo SafeSearch</label>
<type>checkbox</type>
<help>This will force SafeSearch.</help>
</field>
<field>
<id>dnsbl.forcesafeyoutube</id>
<label>Enable Youtube Adult Restrictions</label>
@@ -36,6 +36,10 @@
<default>0</default>
<Required>Y</Required>
</forcesafegoogle>
<forcesafeduckduckgo type="BooleanField">
<default>0</default>
<Required>Y</Required>
</forcesafeduckduckgo>
<forcesafeyoutube type="BooleanField">
<default>0</default>
<Required>Y</Required>
@@ -1,5 +1,6 @@
bing.db:/usr/local/etc/namedb/master/bing.db
blacklist.db:/usr/local/etc/namedb/master/blacklist.db
duckduckgo.db:/usr/local/etc/namedb/master/duckduckgo.db
google.db:/usr/local/etc/namedb/master/google.db
named:/etc/rc.conf.d/named
named.conf:/usr/local/etc/namedb/named.conf
@@ -0,0 +1,12 @@
$TTL 86400
@ IN SOA opnsense.localdomain. hostmaster.opnsense.localdomain. (
2018111401
28800
7200
864000
3600 )
@ NS localhost.
{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeduckduckgo') and OPNsense.bind.dnsbl.forcesafeduckduckgo == '1' %}
duckduckgo.com IN CNAME safe.duckduckgo.com.
www.duckduckgo.com IN CNAME safe.duckduckgo.com.
{% endif %}
@@ -27,7 +27,7 @@ options {
{% endif %}
{% if helpers.exists('OPNsense.bind.dnsbl.enabled') and OPNsense.bind.dnsbl.enabled == '1' %}
response-policy { {% if helpers.exists('OPNsense.bind.dnsbl.type') and OPNsense.bind.dnsbl.type != '' %}zone "whitelist.localdomain"; zone "blacklist.localdomain";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafegoogle') and OPNsense.bind.dnsbl.forcesafegoogle == '1' %}zone "rpzgoogle";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeyoutube') and OPNsense.bind.dnsbl.forcesafeyoutube == '1' %}zone "rpzyoutube";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcestrictbing') and OPNsense.bind.dnsbl.forcestrictbing == '1' %}zone "rpzbing";{% endif %} };
response-policy { {% if helpers.exists('OPNsense.bind.dnsbl.type') and OPNsense.bind.dnsbl.type != '' %}zone "whitelist.localdomain"; zone "blacklist.localdomain";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafegoogle') and OPNsense.bind.dnsbl.forcesafegoogle == '1' %}zone "rpzgoogle";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeduckduckgo') and OPNsense.bind.dnsbl.forcesafeduckduckgo == '1' %}zone "rpzduckduckgo";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeyoutube') and OPNsense.bind.dnsbl.forcesafeyoutube == '1' %}zone "rpzyoutube";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcestrictbing') and OPNsense.bind.dnsbl.forcestrictbing == '1' %}zone "rpzbing";{% endif %} };
{% endif %}
{% if helpers.exists('OPNsense.bind.general.recursion') and OPNsense.bind.general.recursion != '' %}
@@ -89,6 +89,11 @@ zone "rpzgoogle" { type master; file "/usr/local/etc/namedb/master/google.db"; n
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.bind.dnsbl.enabled') and OPNsense.bind.dnsbl.enabled == '1' %}
{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeduckduckgo') and OPNsense.bind.dnsbl.forcesafeduckduckgo == '1' %}
zone "rpzduckduckgo" { type master; file "/usr/local/etc/namedb/master/duckduckgo.db"; notify no; check-names ignore; };
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.bind.dnsbl.enabled') and OPNsense.bind.dnsbl.enabled == '1' %}
{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeyoutube') and OPNsense.bind.dnsbl.forcesafeyoutube == '1' %}
zone "rpzyoutube" { type master; file "/usr/local/etc/namedb/master/youtube.db"; notify no; check-names ignore; };
{% endif %}