今天wget一个网站时,发现很慢:
# wget www.baidu.com
---- ::-- http://www.baidu.com/
Resolving www.baidu.com... 14.215.177.38, 14.215.177.37 ##此处停顿约5秒
Connecting to www.baidu.com|14.215.177.38|:... connected.
HTTP request sent, awaiting response... OK
Length: (.3K) [text/html]
Saving to: “index.html.” %[============================================>] , --.-K/s in 0s -- :: ( MB/s) - “index.html.” saved [/]
默认会优先解析 IPv6,在那个 domain 没有 IPv6 的情况下,会等待 IPv6 解析失败 timeout 之后才按以前的正常流程去找 IPv4
[root@web02 scripts]# wget - www.baidu.com
---- ::-- http://www.baidu.com/
Resolving www.baidu.com... 14.215.177.38, 14.215.177.37
Connecting to www.baidu.com|14.215.177.38|:... connected.
HTTP request sent, awaiting response... OK
Length: (.3K) [text/html]
Saving to: “index.html.” %[============================================>] , --.-K/s in 0s -- :: (96.3 MB/s) - “index.html.” saved [/]
瞬间完成