ubuntu – Docker debian slow dns解决

当我使用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.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...