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

a3.*_*ity 7 unix sockets linux dns networking

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

search example.com 
nameserver 172.16.1.254
nameserver 172.16.2.254
options timeout:3
options attempts:2
Run Code Online (Sandbox Code Playgroud)

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

Rah*_*obi 10

确切地说,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.
Run Code Online (Sandbox Code Playgroud)

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