0

我已经使用 ac 代码缓存了从 dig 命令收到的响应,并且我想使用权限列表直接调用以查找 ip,避免了 dns 查找的一部分,但我不知道该怎么做。

;; AUTHORITY SECTION:
gogole.com.     172748  IN  NS  ns2.google.com.
gogole.com.     172748  IN  NS  ns3.google.com.
gogole.com.     172748  IN  NS  ns1.google.com.
gogole.com.     172748  IN  NS  ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com.     104506  IN  A   216.239.34.10
ns1.google.com.     345589  IN  A   216.239.32.10
ns3.google.com.     104506  IN  A   216.239.36.10
ns4.google.com.     104506  IN  A   216.239.38.10

例如这是 google ,我想下次询问 ns1.google.com 以获得 ip。谁能帮我 ?谢谢。

4

1 回答 1

0

Linuxdig命令的语法在其手册页中进行了描述

man dig

这会告诉你:

A typical invocation of dig looks like:

    dig @server name type

where:

server
    is the name or IP address of the name server to query.
    This can be an IPv4 address in dotted-decimal notation
    or an IPv6 address in colon-delimited notation (...)

因此,一旦您拥有要查询的权威名称服务器的名称或 IP 地址,例如示例中所示的 ns1.google.com,您只需添加@ns1.google.com到 dig 命令行即可从该服务器获取响应。

例如,像这样:

dig @ns1.google.com google.com A

这对于检查区域所有者为该 DNS 记录设置的 TTL 以及解决 DNS 缓存问题很有用。

于 2017-06-15T11:44:15.280 回答