【问题标题】:What will timeout value specified in /etc/resolv.conf do?/etc/resolv.conf 中指定的超时值会做什么?
【发布时间】:2014-02-22 08:15:09
【问题描述】:

例如,/etc/ 中的 resolv.conf 如下所示:-

search example.com 
nameserver 172.16.1.254
nameserver 172.16.2.254
options timeout:3
options attempts:2

在这里,超时 3 表示 3 秒。 但是,超时值有什么意义呢? 是连接到 DNS 服务器所需的时间吗?要么 是否允许等待 DNS 服务器返回 URL 的 IP 地址值?

【问题讨论】:

    标签: linux sockets unix networking dns


    【解决方案1】:

    没错。超时值是通过 DNS 从主机名解析 IP 地址的时间。 server,timeout 选项是减少主机名查找时间

    timeout:n
    sets the amount of time the resolver will wait for a
    response from a remote name server before retrying the
    query via a different name server.  Measured in
    seconds, the default is RES_TIMEOUT (currently 5, see
    <resolv.h>).  The value for this option is silently
    capped to 30.
    

    更多信息请参考http://man7.org/linux/man-pages/man5/resolver.5.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-07
      • 1970-01-01
      • 1970-01-01
      • 2012-05-31
      • 2019-06-20
      • 1970-01-01
      • 2022-07-02
      • 1970-01-01
      相关资源
      最近更新 更多