使用 nsupdate 更新 A 和 PTR 记录时,为什么会出现“更新失败:更新 RR 在区域外 (NOTZONE)”?

Gra*_*ett 5 bind

当使用以下 nsupdate 输入同时分配 A 记录和 PTR 记录时:

server dns01.example.com
update delete pup01.example.com. A
update add pup01.example.com. 300 A 172.29.207.209
update delete 209.207.29.172.in-addr.arpa. PTR
update add 209.207.29.172.in-addr.arpa. 300 PTR pup01.example.com.
send
Run Code Online (Sandbox Code Playgroud)

我们得到 bind9 返回的以下错误:

Sep 23 14:26:12 dns01 named[1070]: client 172.29.207.209#25781/key example.com: view example.com-default: updating zone 'example.com/IN': update failed: update RR is outside zone (NOTZONE)
Run Code Online (Sandbox Code Playgroud)

错误是什么意思?

Gra*_*ett 8

根据 2004 年https://mail-index.netbsd.org/current-users/2004/06/19/0002.html上的错误报告,解决方案如下:

A记录的设置和PTR记录的设置之间需要引入一个空行,像这样:

server dns01.example.com
update delete pup01.example.com. A
update add pup01.example.com. 300 A 172.29.207.209
[blank line goes here]
update delete 209.207.29.172.in-addr.arpa. PTR
update add 209.207.29.172.in-addr.arpa. 300 PTR pup01.example.com.
send
Run Code Online (Sandbox Code Playgroud)

这会导致日志中出现以下内容:

Sep 23 14:40:12 dns01 named[1070]: client 172.29.207.209#36127/key example.com: view example.com-default: updating zone 'example.com/IN': deleting rrset at 'pup01.example.com' A
Sep 23 14:40:12 dns01 named[1070]: client 172.29.207.209#36127/key example.com: view example.com-default: updating zone 'example.com/IN': adding an RR at 'pup01.example.com' A
Sep 23 14:40:12 dns01 named[1070]: client 172.29.207.209#36127/key example.com: view example.com-default: updating zone '29.172.in-addr.arpa/IN': deleting rrset at '209.207.29.172.in-addr.arpa' PTR
Sep 23 14:40:12 dns01 named[1070]: client 172.29.207.209#36127/key example.com: view example.com-default: updating zone '29.172.in-addr.arpa/IN': adding an RR at '209.207.29.172.in-addr.arpa' PTR
Run Code Online (Sandbox Code Playgroud)

希望这可以节省一些时间。

  • 空行相当于“发送”,因此这实际上只是发送两个单独的请求。 (2认同)