As far as I can tell, DNS prefetching is enabled by default in the WebKit trunk, and there is no way to disable it. I'm looking at the trunk as of git commit de240fc8d016a25d9f4b05f65195414375159b3c, corresponding to svn r47855. At WebCore/dom/Document.cpp:4370 there is the following code: m_isDNSPrefetchEnabled = securityOrigin()->protocol() == "http"; So DNS prefetch appears to be on for any http document. I've verified this in the debugger and via packet traces. There should be a WebView preference to disable DNS prefetching. This could be either part of WebPreferences or a direct accessor pair on WebView. I've listed some concerns about DNS prefetching at https://bugs.webkit.org/show_bug.cgi?id=20690#c4 and there are probably a number of other concerns that I'm not even qualified to imagine. I believe that item 2) is ok in the current implementation, but 1) and 3) still need to be addressed. It's not clear whether 4) has been handled adequately -- it appears that the DNS queue is limited to 64 requests, but I haven't tested how these requests impact the system, especially with other internet apps running simultanously, such as a syndicated feed reader. In any case, I think that people would have very legitimate reasons for wanting to disable DNS prefetching.
<rdar://problem/7181249>
Is anybody working on this? DNS prefetching has now been in the trunk for 19 months: http://trac.webkit.org/changeset/36650/trunk 19 months, yet there is still no way to turn it off, short of modifying the WebKit code yourself and recompiling. I don't understand how the original patch was even accepted without a way of turning off DNS prefetching. People using the WebKit nightly builds are probably unaware that DNS prefetching is on, because nobody has publicly mentioned this feature, e.g., on the WebKit blog. It was such a stealth update that the svn commit message itself was empty. (Probably an oversight, but a pretty bad one for an important change like this.) I hope at least that rdar://problem/7181249 is blocking the release of DNS prefetching in Mac OS X. I've been checking after each release if it's there and haven't seen it yet. I can guarantee that there will be a public stink if this goes into Mac OS X without any way of disabling it. I would submit a patch myself, but I don't feel qualified. I have only a passing familiarity with C++ and with the WebKit architecture.
Created attachment 60270 [details] Proposed patch
Comment on attachment 60270 [details] Proposed patch > + [NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey, Why the strange formatting here? The lines are not lined up, but there are extra spaces.
Fixed the spacing issue. Thanks!
Landed in r62284.