我有一个DNS服务器,它有两个视图,一个用于内部用户,另一个用于外部(例如internet)。我想配置RPZ,以便当内部用户请求(外部递归查询无论如何都会被拒绝)一个示例网站时,他们将被重定向到另一个网站(过滤页面),显示不允许访问该网站。但是RPZ不能工作,查询bad.com返回它的真实地址。我找不出问题。
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
8.8.8.8;
};
response-policy {zone "filter" recursive-only no;};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
# dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
acl internal {172.17.116/24; 192.168.20/24; 127/8;};
view "internal" {
match-clients {internal;};
recursion yes;
zone "wsi.org" {
type master;
file "/etc/bind/internal.zone";
};
zone "filter" {
type master;
file "/etc/bind/filter.zone";
};
include "/etc/bind/named.conf.default-zones";
};
view "external" {
match-clients {any;};
recursion no;
zone "wsi.org" {
type master;
file "/etc/bind/external.zone";
};
zone "filter" {
type master;
file "/etc/bind/filter2.zone";
};
include "/etc/bind/named.conf.default-zones";
};TTL 604800
@ IN SOA wsi.org. root.wsi.org. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
bad.com A filter.wsi.org
bad.net A filter.wsi.orgTTL 604800
@ IN SOA wsi.org. root.wsi.org. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
bad.com A filter.wsi.org
bad.net CNAME rpz-passthrunslookup总是显示bad.net和bad.com的真实地址。
我在做实验,这就是为什么有两个区域。
发布于 2016-10-21 18:24:22
第一次改正记录:
bad.com A filter.wsi.org 至:
bad.com A 192.168.1.1或者改变如下:
bad.com CNAME filter.wsi.org和下面的测试配置:
response-policy {zone "filter";};发布于 2016-10-22 16:32:16
我发现了另一个问题,您在rpz区域文件中找不到ns记录。
@ NS 127.0.0.1.并使用绑定工具对配置进行故障排除。用于检查配置语法:
named-checkconf对于检查区域文件语法:
named-checkzone filter /etc/bind/filter.zone对于检查,bind运行时没有出现错误:
netstat -lntup | grep 53https://unix.stackexchange.com/questions/317976
复制相似问题