Linux /etc/resolv.conf 中指定的超时值有什么作用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21449510/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What will timeout value specified in /etc/resolv.conf do?
提问by a3.14_Infinity
For example, resolv.conf in /etc/ looks like this:-
例如,/etc/ 中的 resolv.conf 如下所示:-
search example.com
nameserver 172.16.1.254
nameserver 172.16.2.254
options timeout:3
options attempts:2
Here, timeout 3 means 3 seconds. But, what is the significance for timeout value? Is it the time taken to connect to DNS server? OR Is it the time allowed to wait for DNS server to return IP address value for a URL?
在这里,超时 3 表示 3 秒。但是,超时值有什么意义呢?连接到DNS服务器需要时间吗?或者是否允许等待 DNS 服务器返回 URL 的 IP 地址值的时间?
采纳答案by Rahul R Dhobi
Yes exactly. Timeout value is time to resolving IP address from hostname through DNS. server,timeout
option is to reduce hostname lookup time
对,就是这样。超时值是通过 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.
Refer http://man7.org/linux/man-pages/man5/resolver.5.htmlfor more information
有关更多信息,请参阅http://man7.org/linux/man-pages/man5/resolver.5.html