大网数据广告活动
网站运营与故障问答

Why does DNS lookup take more than 6 seconds?

· 52CE 我爱测

I am running a photography website for my girlfriend, and currently trying to improve the site's loading speed. It is a photography website, and thus many images are loaded, which makes it a little slow. This is expected and acce…

问题原文

原帖链接 · Gasp0de · CC BY-SA 3.0

I am running a photography website for my girlfriend, and currently trying to improve the site's loading speed. It is a photography website, and thus many images are loaded, which makes it a little slow. This is expected and accepted to some extent.

However, when I looked at the waterfall diagram in Chrome, which shows loading time of different resources, I noticed that "DNS Lookup" of some images takes up to 6 seconds. This is weird, as the images are hosted on my own page, and other content (css, html) has already been loaded from the same domain at that point, so no additional DNS lookup should be necessary. What is happening here? Is it really a DNS lookup? If so, why does it take so long?

已采纳解答

原帖链接 · Tom Brossman · CC BY-SA 3.0

DNS lookups are not taking six seconds for all users, and you can confirm this by testing DNS speed with and of the third-party DNS speed testing services. Here is one example result from SolveDNS' test showing that DNS responses are actually very fast for the domain: http://www.solvedns.com/dnsspeedtest/evamilbrandt.de

Looking at the bigger picture, it appears that your web server does not have Keep Alive enabled, which is very strange. Enabling this is recommended (it is enabled by default) and will likely resolve the DNS issue because established connections will be re-used.

If speed is the goal, you have other optimizations you can make which are beyond the scope of this question, but you can consult a third-party testing site like GTmetrix for feedback on how fast your site is and what can be done to improve page load time. Here's a test I just ran for example: https://gtmetrix.com/reports/evamilbrandt.de/WN0LkH9B

Nice looking site by the way, now go make it fast and everyone will be happy!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。