DuckDuckGo in Safari sans hacks
I’ve been using DuckDuckGo as my main search engine for a while now because it has good results and moreover because it lets me search key sites I use quickly through their somewhat salaciously named “bang-syntax”.
Now, Safari is extensible but sadly its Search Engines are not, so to use DDG you have to either add a toolbar (ugh, so Microsoftian), install a gaggle of horrible haxies or even worse, modify Safari’s binary and then do that every time Safari is updated. Fun!
The last two options are dubious at best and will likely be partially or fully blocked in Mountain Lion, unleashing the wrath of Judgement Cat upon thee.
Luckily there is a final option DDG doesn’t mention on its search page but does list buried in DDG’s Safari help page: simply add a single entry to your hosts file.
A quick word here for people unused to editing anything beyond their iPhoto collection: you’re better off making DDG your start page for each tab in Safari’s preferences. For those comfortable with text editors and /lots/of/slashes/, please continue.
Open /etc/hosts using your favorite text editor. Your editor must be able to save files owned by root.
Add the following line to the file, making sure the whole thing is on a line by itself:
184.72.115.86 search.yahoo.com
Save. You may be prompted for your Administrator password at this time. Enter it and confirm. Close the file.
The sharper ones among you will have noticed we have just routed Yahoo’s search domain somewhere else, namely DuckDuckGo’s IP. Now why is that?
Safari has 3 search engines: Teh Goog, Bing and Yahoo. The one no one, ever, is going to use is Yahoo. Since you won’t be using it anyway, you might as well point its domain name somewhere else. Those crafty Ducksters!
Back to Safari, click on the little loupe in the search field and change your engine to Yahoo — which now points to DDG — and done. Yes, you will be reminded of some dinosaur web company daily but at least you can Duck it.