我正在尝试使用Bind9(Linux(部署dns转发器。我希望我的服务器能够分析请求,并将其转发到外部DNS(互联网(或实现的内部使用条件。因此,我们将使用:DNS转发器:将分析并将请求转发到内部或外部DNS的服务器内部DNS:仅解析内部名称的服务器(domain.company(DNS:8.8.8.8:解析外部地址
因此,目标是当我尝试解析域名/URI时。如果是内部请求,则应将其转发到内部DNS,否则应将其发送到8.8.8.8
Exemple1 : nslookup google.com should be forwarded to 8.8.8.8
Exemple2 : nslookup application.domain.company should be forwarded to internal dnsserver
这里是/etc/named.conf 的内容
//
// named.conf
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 { any; };
auth-nxdomain no;
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
recursion yes;
allow-query { 127.0.0.1; IPCLIENT2; IPclient1; };
forwarders {
8.8.8.8;
};
forward first;
dnssec-enable yes;
dnssec-validation auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "domain.compagny" IN {
type forward;
forward only;
forwarders { IP_internaldns; };
};
zone "domain2.compagny" IN {
type forward;
forward only;
forwarders { IP_internaldns; };
};
#include "/etc/named.rfc1912.zones";
#include "/etc/named.root.key";
这里如果我执行:nslookup google.com or yahoo
它正确解析但如果我执行nslookup application.domain.compagny
,它会显示:找不到XXXXXXXX:SERFFAIL
感谢
你是说"公司";或";compagny"?
尝试以下区域配置:
zone "domain.company" {
type forward;
forwarders { IP_internaldns; };
};
zone "domain2.company" {
type forward;
forwarders { IP_internaldns; };
};