我正在尝试仅为孩子应用“restrictmoderate.youtube.com”,并让其他人使用 Bind9 访问标准的“youtube.com”。
# 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.
我不明白为什么“rpz”区域适用于所有人(192.168.1.0/24 和 192.168.2.0/24),而我希望它只适用于“儿童”ACL(192.168.2.0/24) :
allow-query { kids; !adults; };
我究竟做错了什么?谢谢你的帮助。