Toggle DNS Prefetching in Safari

To improve performance Safari (and other Webkit based browsers) will attempt to prefetch DNS data. In some circumstances this can result in slow or partial webpage loading, or webpage cannot be found errors. In those scenarios this tweak can be used to disable DNS prefetching.


To implement this tweak:

  1. Start a new Terminal session (in Finder click Applications > Utilities > Terminal).

  2. To disable this setting, type (or copy and paste) the following command:

    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
  3. To reset this setting to the default value, type (or copy and paste) the following command:

    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean true
  4. To activate this tweak please close all instances of Safari, or wait until the next reboot.

  5. Close the Terminal session by typing exit at the prompt.

Disclaimer: Making any changes to your system can cause serious problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from these modifications can be resolved. Please follow the instructions carefully and use the information provided at your own risk.