在这个问题之前,我一直在寻求一些帮助,帮助我找到一种方法,根据客户端的IP地址返回不同的响应。问题在这里得到了回答:如何有选择地覆盖绑定DNS服务器上的某些A记录?
我遵循了公认的答案,现在遇到了一些问题。
当我跑步时:
nslookup faq.test.com 我希望这样做:
root@dev:/etc/bind# nslookup vaultofsatoshi.com
Server: 172.16.225.132
Address: 172.16.225.132#53
Non-authoritative answer:
Name: faq.test.com
Address: 192.168.1.1不过,我明白这一点:
root@dev:/etc/bind# nslookup faq.test.com
Server: 172.16.225.132
Address: 172.16.225.132#53
** server can't find faq.test.com: NXDOMAIN我应该提到,查询google.com或任何其他网站都会正常工作,并返回所有的内容,只是我覆盖的那些网站失败了。我已经包括了我的配置文件下面,任何帮助将不胜感激。
/etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";/etc/bind/named.conf.选项
options {
directory "/var/cache/bind";
forwarders {
8.8.8.8;
8.8.4.4;
};
response-policy {
zone "development-overrides";
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
allow-query { trusted; };
allow-recursion { trusted; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
};/etc/bind/named.conf.
include "/etc/bind/rndc.key";
acl "trusted" {
172.16.225.132;
127.0.0.1;
};
include "/etc/bind/zones.override";
logging {
channel bind_log {
file "/var/log/named/named.log" versions 5 size 30m;
severity info;
print-time yes;
print-severity yes;
print-category yes;
};
category default { bind_log; };
category queries { bind_log; };
};/etc/bind/named.conf.默认区域
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};/etc/绑定/开发-重写
$TTL 1H
@ SOA LOCALHOST. test.com (1 1h 15m 30d 2h)
NS LOCALHOST.
support.test.com A 192.168.1.1
faq.test.com A 192.168.1.1
; do not rewrite (PASSTHRU) OK.DOMAIN.COM
* A rpz-passthru.发布于 2014-08-01 22:05:50
RPZ区域中的最后一行在语法上并不有效。
RPZ区域的语法与常规区域的语法相同,它只对RPZ具有特殊的语义。
考虑到这一点,很明显,A记录不可能有rpz-passthru.,因为它的值。A记录只能有一个IPv4地址作为其值。
如果查看RPZ文档,您会发现特殊的RPZ指令(如rpz-passthru.)使用CNAME记录类型。
named-checkconf -zj和/或读取日志通常是有帮助的。我假设,当使用来自问题的区域数据时,RPZ区域将无法加载,并且应该会出现错误(我预计会出现关于“坏虚线四边形”的错误或类似于这些内容的错误)。
作为一个单独的注意,我不认为最后一行是真正需要的,它似乎只是(尝试)明确定义默认行为是什么。
https://serverfault.com/questions/617313
复制相似问题