【问题标题】:How to call authoritative server for ip response?如何调用权威服务器进行ip响应?
【发布时间】:2017-11-17 15:27:19
【问题描述】:

我已经缓存了使用ac代码从dig命令收到的响应,我想使用authorities list直接调用查找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。谁能帮我 ?谢谢。

【问题讨论】:

    标签: java linux dns dig authority


    【解决方案1】:

    Linux dig 命令的语法在其手册页中有描述

    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 缓存问题很有用。

    【讨论】:

      猜你喜欢
      • 2018-10-20
      • 1970-01-01
      • 2013-01-10
      • 2012-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-03
      • 2015-04-17
      相关资源
      最近更新 更多