How can I disable DNS caching in Safari?
12,323
Solution 1
Clear the OS cache:
sudo killall -HUP mDNSResponder
Disable Safari DNS prefetching:
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
Solution 2
Update: for Yosemite to clear the cache you want:
sudo discoveryutil udnsflushcaches
Solution 3
In Safari 12.1 this should have been moved to:
defaults read com.apple.Safari WebKitPreferences.dnsPrefetchingEnabled
With:
defaults write com.apple.Safari WebKitPreferences.dnsPrefetchingEnabled -boolean false
you should be able to disable it.
Related videos on Youtube
Author by
EricKitt
Updated on September 16, 2022Comments
-
EricKitt over 1 year
I'd like to disable Safari on Mac OS X from performing DNS caching.
Is there a way to do that through configuration or any other setting ? -
malhal about 8 yearsThis defaults write doesn't work on El Capitan, even tried restarting Safari. To test I added a loopback entry for Google to my hosts file and reload in Safari still worked.