我使用 BIND 9.9.4 并看到以下问题。
dig 命令向我们显示 ADDITIONAL 部分中有 2 条记录:
ADDITIONAL: 2
但它实际上只向我们显示了响应中的 1 条记录:
;; ADDITIONAL SECTION:
dns1.example.net. 3600 IN A 127.0.0.1
root:/etc/namedb/keys# dig @127.0.0.1 foo.example.net any
; <<>> DiG 9.9.1-P1 <<>> @127.0.0.1 foo.example.net any
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20991
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;foo.example.net. IN ANY
;; ANSWER SECTION:
foo.example.net. 3600 IN A 192.168.10.10
;; AUTHORITY SECTION:
example.net. 86400 IN NS dns1.example.net.
;; ADDITIONAL SECTION:
dns1.example.net. 3600 IN A 127.0.0.1
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jun 11 16:34:26 2012
;; MSG SIZE rcvd: 95
最佳答案
从技术上讲,这不是一个错误,而是令人困惑的演示。在 9.9 中,dig 开始默认打开 EDNS(0),因此响应会在附加部分返回 OPT 记录。 OPT 没有定义的文本输出格式,因此它不会打印为记录;你能知道它在那里的唯一方法是在顶部附近寻找“OPT PSEUDOSECTION”字样。但它是附加部分中的一条额外记录,因此您看到的计数是正确的。
如果您在 9.8 中使用“dig +edns=0”或在 9.9 中使用“dig +noedns”,计数将匹配。
关于dns - BIND 9.9 显示的 ADDITIONAL SECTION 数量是否错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19047810/