/etc/resolv.conf中指定的超时值是什么?

时间:2014-01-30 06:39:09

标签: linux sockets unix networking dns

例如,/ 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地址值的时间吗?

1 个答案:

答案 0 :(得分:8)

确切地说,Timeout值是从主机名通过DNS服务器解析IP地址的时间,超时选项是减少主机名查找时间

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