I'm trying to apply "restrictmoderate.youtube.com" only for kids and let the others access the standard "youtube.com", using Bind9.
# cat named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
==========================================================================
# cat named.conf.options
acl goodclients {
192.168.0.0/16;
localhost;
localnets;
};
acl kids { 192.168.2.0/24; };
acl adults { 192.168.1.0/24; };
options {
directory "/var/cache/bind";
recursion yes;
allow-query { goodclients; };
// forward traffic to opendns
forwarders { 208.67.222.222; 208.67.220.220; };
forward only;
dnssec-enable yes;
dnssec-validation yes;
// Conform to RFC1035
auth-nxdomain no;
// Force youtube.com to restrictmoderate.youtube.com
response-policy { zone "rpz"; };
listen-on-v6 { none; };
querylog yes;
};
==========================================================================
# cat named.conf.local
//include "/etc/bind/zones.rfc1918";
logging{
channel simple_log {
file "/var/log/bind/query.log" versions 3;
severity info;
print-time yes;
print-severity yes;
print-category yes;
};
category default{
simple_log;
};
};
zone "rpz" IN {
type master;
file "/etc/bind/rpdb.zone";
allow-query { kids; !adults; };
};
==========================================================================
# cat rpdb.zone
$ORIGIN rpz.
$TTL 1H
@ IN SOA localhost. root.localhost. (
7
1H
15m
30d
2h )
NS LOCALHOST.
www.youtube.com IN CNAME restrictmoderate.youtube.com.
m.youtube.com IN CNAME restrictmoderate.youtube.com.
youtubei.googleapis.com IN CNAME restrictmoderate.youtube.com.
youtube.googleapis.com IN CNAME restrictmoderate.youtube.com.
www.youtube-nocookie.com IN CNAME restrictmoderate.youtube.com.
google.com IN CNAME forcesafesearch.google.com.
www.google.com IN CNAME forcesafesearch.google.com.
I don't understand why the "rpz" zone is applied to everyone (192.168.1.0/24 and 192.168.2.0/24) while I'm expecting it to only apply to the "kids" ACL (192.168.2.0/24):
allow-query { kids; !adults; };
What am I doing wrong? Thanks for your help.