NOTE: This feature is currently in beta. The server IP below will change when the beta ends.
As discussed here, Safari doesn’t allow you to customize the search engines available from the search bar.
However, there is a simple hack you can do. DuckDuckGo operates a server that can respond to Safari’s search requests directed at Yahoo, Google, or Bing, and send those to DuckDuckGo instead. To use it, you can either use an app to make the change, or edit your hosts file directly.
A third-party app which can set this up automatically for you is available here. Note that this app is not provided by DuckDuckGo.
After you use this app, selecting Yahoo in the Safari search bar will search DuckDuckGo instead. Likewise, if you set your default to Yahoo in Safari Preferences, your default will actually be DuckDuckGo.
If you change your mind, open the app again to undo the changes.
This is intended only for advanced users.
Mac users: Open the Terminal app. This is in your Applications folder, in the Utilities folder.
Type this command:
sudo nano /etc/hosts
You will be asked for your password. Type it and press return. Note that nothing will appear in the window as you are typing; this is normal.
This starts the Nano text editor. Use the arrow keys to move to the end of the file, press return a few times, and add this line:
72.94.249.35 search.yahoo.com
Then save the file by pressing Control-O, and quit Nano by pressing Control-X.
TODO: Instructions for Windows users
Restart Safari after you do this. From now on, selecting Yahoo in the Safari search bar will search DuckDuckGo instead. Likewise, if you set your default to Yahoo in Safari Preferences, your default will actually be DuckDuckGo.
You can use this same trick to replace Google or Bing in the Safari search bar; substitute one of these lines instead (there’s no need to use more than one):
72.94.249.35 www.google.com
72.94.249.35 www.bing.com
BIG WARNING: Using one of the two above lines will block all of Google or Bing, respectively: you will not be able to access Gmail, Google Maps, etc. This is probably not what you want. Since Yahoo Search is on a separate subdomain, using this trick with Yahoo does not have this downside (i.e., Yahoo Mail, Yahoo Maps, and the rest of Yahoo are unaffected). For this reason, it’s recommended to use the Yahoo line.
To undo the changes, simply run Nano again and remove the lines you added. Don't change anything else in the file.
Did you know? You can control-click any word in any app on Mac OS X and select ‘Search with...’, and it opens a search in your default Safari search engine (which you can set to DuckDuckGo!).
Please add support for mail.ru and yandex.ru:
http://go.mail.ru/search?fm=1&q=
https://yandex.ru/search/?text=