我有一个Ubuntu 12.04服务器和DNS查找似乎是非常缓慢的。 time curl www.google.com需要40秒, time curl 173.194.74.147需要time curl 173.194.74.147 。 我用Ubuntu 12.04重新安装了另一台专用服务器,它也有同样的问题。
问题:我被要求检查我的DNSconfiguration。 所以我添加了谷歌的DNS服务器,但我仍然得到缓慢的DNS解决。 我还应该检查什么?
在/ etc /决心/ conf目录
nameserver 127.0.0.1 nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 213.186.33.99 search ovh.net
我刚刚有这个问题。 我不知道你的情况,但对我来说,这是一个IPv6networking问题:
me@server:~$ time wget -O /dev/null google.com --2014-08-26 09:44:15-- http://google.com/ Resolving google.com (google.com)... 2607:f8b0:4005:800::100e, 74.125.239.98, 74.125.239.100, ... Connecting to google.com (google.com)|2607:f8b0:4005:800::100e|:80... ^C real 1m32.876s user 0m0.000s sys 0m0.000s
1.5分钟后,我不得不使用Ctrl + C来停止wget 。 请注意, 2607:f8b0:4005:800::100e表示IPv6查找。 我在/etc/sysctl.conf添加了以下几行:
# Disable IPv6 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
然后刷新这些设置: sudo sysctl -p来源: http : //www.noobslab.com/2012/05/disable-ipv6-if-your-internet-is.html
一旦我这样做,事情开始工作:
me@server:~$ time wget -O /dev/null google.com --2014-08-26 09:46:12-- http://google.com/ Resolving google.com (google.com)... 74.125.239.98, 74.125.239.100, 74.125.239.102, ... Connecting to google.com (google.com)|74.125.239.98|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://www.google.com/ [following] --2014-08-26 09:46:12-- http://www.google.com/ Resolving www.google.com (www.google.com)... 74.125.239.115, 74.125.239.112, 74.125.239.116, ... Connecting to www.google.com (www.google.com)|74.125.239.115|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: `/dev/null' [ <=> ] 19,139 --.-K/s in 0.002s 2014-08-26 09:46:12 (10.6 MB/s) - `/dev/null' saved [19139] real 0m0.093s user 0m0.004s sys 0m0.000s
注意:您可以运行wget google.com但会将文件保存在当前位置。 -O /dev/null会压制这个。