Friday, November 1, 2013

Add Your Choice of Search Engine

In its Preferences dialog box, Safari lets you choose between three different search engines that will be used whenever you type anything into the Address and Search bar: Google, Yahoo, or Microsoft’s Bing. Other popular search engines are available, such as Duck Duck Go (www.duckduckgo.com), but Safari offers no way to utilize them via the Address and Search bar.

It’s possible to force Safari to use a search engine like Duck Duck Go, but it involves a systemwide hack that essentially redirects all traffic for one of the existing search engines, such as Bing, to a replacement you specify. The changes you make will affect all software installed on your system, not just web browsers, and all user accounts too. This usually isn’t problematic, however, and if you’re sure other users of the system will never, ever use the search engine that you intend to replace, then it’s a good change to make.

Adding Your Own Search Engine

Here are the necessary steps. These steps make fundamental changes to a system file, and while this is generally safe to do, you should follow the steps and ensure you type the commands exactly as specified.

1. For the purposes of these steps, we’re going to use Duck Duck Go as the replacement search engine, and we’re going to replace Bing. Start by get- ting the IP address of the search engine you want to use—open a Terminal window (open Finder, select the Applications list, and then in the list of applications double-click Terminal within the Utilities folder), and type ping followed by the address of the search engine. 
For example, for Duck Duck 
Go I’d type the following:

ping www.duckduckgo.com

2. Don’t worry about all the results, but simply look at the first line, which will read something like PING duckduckgo.com(46.51.197.88). You’re interested in the numbers—46.51.197.88—so make a note of them. 3. At the Terminal, hit Control+ C to kill the ping command, and type the fol- lowing, which will open the hosts system file in the nano text editor (type your login password when prompted):

sudo nano /private/etc/hosts

4. In the file that you open, add the following line to the very bottom on a line of its own, ensuring you hit a carriage return at the end of the line:

46.51.197.88 www.bing.com

Obviously, you should replace the IP address (the series of four numbers separated by periods) with the one you wrote down earlier, although don’t change anything else in the line

5. Hit Control+ O to save the file, and tap Return to confirm you want to save it. Then hit Control+ X to quit Nano, and then close the Terminal window. 

6. Open Safari, and hit Command+ , (comma) to access its preferences. Select the General tab, and on the Default Search Engine drop-down list, select Bing.

The changes should take effect from the next time you use Safari, but if not, reboot the computer.

Note that Safari might still display “Bing Search” in the Address and Search bar, but in fact, anything you type will be sent to your choice of search engine.

Reversing the Changes

To reverse the procedure and restore the ability to use Bing as a search engine, repeat the previous steps to edit the /private/etc/hosts file and remove the line you added (you can do this by using the cursor keys to position the cursor at the end of the line and then using the Delete key). Then save the file, as explained earlier, and quit Nano. You might need to reboot if, when using Safari, the changes don’t take effect immediately.

No comments:

Post a Comment