我在 Redhat 7.4 上使用 chroot 在主/从配置中运行 BIND 9.9.4。服务器在 named.conf 文件中使用“recursion no;”选项进行设置。我的一个区域文件中有一个条目:
test IN CNAME server.outsidedomain.com.
当我向 DNS 服务器查询 test.mydomain.com 时,我希望它返回 server.outsidedomain.com 的 IP 地址,但不会“递归”任何其他查找(实际上,我有少量指向我域外的主机的 CNAME 记录)。
区域文件片段:(已清理)
$TTL 3h
@ IN SOA ns01.mydomain.com. admin.mydomain.com. (
2018032007 ; serial number
2h ; refresh
1h ; retry
4d ; expire
1d ; default TTL
)
@ NS ns01.mydomain.com.
@ NS ns02.mydomain.com.
test CNAME server.outsidedomain.com.
named.conf 片段:(已清理)
options {
listen-on port 53 { any; };
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";
allow-query { any; };
allow-query-cache { 1.1.1.2; };
allow-transfer { key "ns02.mydomain.com"; };
recursion no;
dnssec-enable yes;
dnssec-lookaside auto;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
version "Unavailable";
};
nslookup 输出:(已清理)
# nslookup test.mydomain.com
Server: 1.1.1.1
Address: ns01.mydomain.com
Name: server.outsidedomain.com
挖掘输出:(已净化)
dig test.mydomain.com
; <<>> DiG 9.11.3 <<>> test.mydomain.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36042
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test.mydomain.com. IN A
;; ANSWER SECTION:
test.mydomain.com. 10800 IN CNAME server.outsidedomain.com.
我希望/期望看到:(已净化)
# nslookup test.mydomain.com
Server: ns01.mydomain.com
Address: 1.1.1.1
Name: server.outsidedomain.com
Address: 5.5.5.5
Aliases: test.mydomain.com