TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Saved 10 billion DNS queries per month by disabling DNS Prefetching

159 pointsby necroabout 14 years ago

12 comments

Xkabout 14 years ago
That's all very nice, but it seems to do more with the fact that each person gets his/her own subdomain. And given that I found three xss's in about five minutes [edit: and then like ten more in the next five seconds, after realizing any input box works] doesn't give me confidence in their abilities.<p><a href="http://www.pinkbike.com/news/search/?q=%3C%2Ftitle%3E%3Cscript%3Ealert%28%22xss%22%29%3C%2Fscript%3E&#38;x=0&#38;y=0" rel="nofollow">http://www.pinkbike.com/news/search/?q=%3C%2Ftitle%3E%3Cscri...</a><p><a href="http://www.pinkbike.com/product/compare/?items=466,%22%3E%3Cscript%3Ealert%28%22xss%22%29%3C/script%3E" rel="nofollow">http://www.pinkbike.com/product/compare/?items=466,%22%3E%3C...</a><p><a href="http://www.pinkbike.com/photo/list/?date=all&#38;text=%3C/title%3E%3Cscript%3Ealert%28%22xss%22%29%3C/script%3E" rel="nofollow">http://www.pinkbike.com/photo/list/?date=all&#38;text=%3C/ti...</a><p><a href="http://www.pinkbike.com/buysell/list/?q=%3Cscript%3Ealert%28%22xss%22%29%3C%2Fscript%3E&#38;category=0&#38;pmin=&#38;pmax=&#38;region=3" rel="nofollow">http://www.pinkbike.com/buysell/list/?q=%3Cscript%3Ealert%28...</a><p><a href="http://www.pinkbike.com/forum/search/?q=%3C/title%3E%3Cscript%3Ealert%28%22xss%22%29%3B%3C%2Fscript%3E" rel="nofollow">http://www.pinkbike.com/forum/search/?q=%3C/title%3E%3Cscrip...</a><p>Edit: I've stopped adding xss's. It's actually harder to find input boxes which <i>don't</i> lead to xss's than ones which do.
评论 #2307658 未加载
arsabout 14 years ago
Summary (he really should have said this part upfront):<p>He is (ab)using subdomains, by giving every user a different subdomain on his site. So a typical page can have links to hundreds of different subdomains on the page.<p>For a normal site disabling prefetching is not necessary or a good idea.<p>This article should be renamed: "Why using hundreds of unique subdomains is not a good idea." Besides all the DNS queries, you are also messing with caches.<p>I don't know anything about his site, but I don't see any reason that every user needs a unique subdomain.
评论 #2306905 未加载
评论 #2307011 未加载
评论 #2306932 未加载
daviduabout 14 years ago
The real issue is that the cost per query is negligible here and DNS providers shouldn't charge by the query yet almost <i>all</i> of them do. They have to have some metric to separate the big guys from the little guys and charge the big guys more, but this is a crude way to do it.<p>Consider that publishers often have little control of how many DNS requests they get, so to charge for something out of your control seems utterly bizarre to me. Nice to see in this instance, publisher was able to make a meaningful improvement.<p>Also keep in mind, I used to run the largest free DNS service in the world so I'm well aware of what I'm talking about and am totally biased on these matters. :-)
评论 #2306842 未加载
评论 #2308381 未加载
coderdudeabout 14 years ago
I'm surprised the article doesn't actually tell you the meta http-equiv to disable DNS prefetching. It mentions that it helped out tremendously, though. Here it is:<p>&#60;meta http-equiv="x-dns-prefetch-control" content="off" /&#62;<p>or, if you're more into HTML5:<p>&#60;meta http-equiv="x-dns-prefetch-control" content="off"&#62;
评论 #2306717 未加载
评论 #2306730 未加载
joshfraserabout 14 years ago
Before everyone goes rushing off to disable DNS prefetching, remember that DNS prefetching is generally a good thing that exists to make websites faster. And the faster your site is the more pageviews you can expect. Faster sites also have a lower bounce rate and better pagerank from Google.
评论 #2307227 未加载
Rantenkiabout 14 years ago
This implies that providers are either severely limiting their caches, or expiring in a shorter than posted TTL. Even though pinkbike looks like it has thousands of users, one would expect the front pages to be largely identical for most user sessions, so the ISP dns caches should already have most of those username.domain.com records cached. Either that or the ISP's DNS servers are more numerous and distributed, with fewer customers each, or something like that.<p>Anybody at an ISP that can fill us in on DNS TTL mangling or cache limiting?
评论 #2307573 未加载
评论 #2306799 未加载
patrickgzillabout 14 years ago
I am actually rather shocked that people are being charged extra for DNS - surely the answer is to get any sort of cheap VPS and put DNS on that box? Then again, why are you depending for all aspects of your site's working at all, on a service which costs $2/month?<p>Even a 128MB RAM VPS could comfortably handle a huge number of requests.
评论 #2307933 未加载
datumsabout 14 years ago
Create an A Record for your highest queried subdomain. Those will be cached and eventually decrease the number of queries. Depending on the number of subdomain you can create and remove it on signup and cancellation.
ck2about 14 years ago
short answer for Firefox<p><pre><code> about:config network.dns.disablePrefetch (true) network.dns.disablePrefetchFromHTTPS (true)</code></pre>
评论 #2308413 未加载
评论 #2307631 未加载
andrewcookeabout 14 years ago
ok i'm confused. why doesn't dns wildcard caching solve this?
评论 #2308451 未加载
gcbabout 14 years ago
+ saved 10 billion DNS queries per month.<p>- wasted a total of 10sec of each user's time per month.<p>it's all about trade offs
评论 #2308457 未加载
评论 #2307223 未加载
评论 #2307431 未加载
togasystemsabout 14 years ago
As a fellow Mountain biker, I was surprised and glad that I saw pinkbike on HN.