用正向查找修改反向查找

Modify reverse lookup with forward lookup

我有一个 CLI 脚本,它 运行 通过 NSUPDATE 用于 DDNS unix 服务器。它根据需要接受用户输入和 adds/modifies/deletes 记录。我不确定如何或是否可以在更改正向区域记录时修改反向区域记录。说

nslookup host1.zone1 = 1.2.3.4
nslookup 1.2.3.4  = host.zone1

我想运行 nsupdate 如下。

nsupdate
server info ....
update add host1.zone1 86400 IN A 5.6.7.8
send

我想知道是否有办法 link 将反向记录转换为正向记录,因此只需编辑正向区域记录即可更改两者。

nslookup host1.zone1 = 5.6.7.8
nslookup 5.6.7.8 = not found (want this to show host1.zone1)
nslookup 1.2.3.4 = host1.zone1 (want this to show not found)

从第一个 link 开始 googling "man nsupdate reverse":

Adding records

Here are examples of how to add A, CNAME, and PTR records. One must specify the TTL (time-to-live) of records (in seconds) when they are added.

update add www1.example.com 86400 a 172.16.1.1
update add www.example.com 600 cname www1.example.com.
send

update add 1.1.16.172.in-addr.arpa 86400 ptr www1.example.com.
send 

Note that I have taken care to use two separate "send" commands to handle the A and PTR updates of www1.example.com since the changes apply to two different zones, example.com and 1.16.172.in-addr.arpa.

请记住,反向记录是 PTR,而不是 A。我不知道在哪里可以 link 它们,以便一个命令同时执行这两项操作,因为它们是单独的记录。但是,如果您正在编写前锋脚本,那么您已经拥有 PTR 的信息。