当我使用wget或curl,apt-get,…时,我的ubuntu中的dns解析速度非常慢
root@815340a37f0e:/# time curl www.google.com ... real 0m5.132s user 0m0.006s sys 0m0.003s
当我做nslookup它非常快.
root@815340a37f0e:/# time nslookup google.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: google.com Address: 173.194.78.101 ... real 0m0.024s user 0m0.010s sys 0m0.005s
我们遇到了同样的问题,我们发现了
that our hardware showed broken behaviour with IPv6.
你可以用curl仔细检查并强制IPv4如下:
$time curl -4 www.google.com ... real 0m0.074s user 0m0.011s sys 0m0.000s
更新1:
我们的Windows主机系统存在问题(Ubuntu 14.04是来宾).实际解决方案发现于this page.
添加选项single-request-reopen到/etc/resolvconf/resolv.conf.d/base并运行sudo resolvconf -h为我们做了诀窍.
我在askubuntu发现了另一个表示几乎相同的anwser.