One method of changing the search engine in Safari

May 12, '03 08:59:00AM

Contributed by: lhatton

If you like the idea of the search bar in the Apple Safari web browser but want to use an alternative search engine (some good reasons why you may want to do this can be seen here), with a little work you can change the search engine it uses. There seem to be only two search engines which can interpret Google's query format:

www.AllTheWeb.com
www.Teoma.com

Firstly, you must obtain the IP address of the relevant host for the search engine you want to use. To find their IP numers, open a terminal window and type nslookup www.searchengine.com. Replace www.searchengine.com with the relevant host listed above for the search engine you want to use. The answer will appear like this:

Server:  yalumba.connect.com.au
Address:  203.8.183.1

Non-authoritative answer:
Name:    www.alltheweb.com
Address:  66.77.74.20

Copy the IP address from the last part (after "Non-authoritative answer:") into the clipboard. Then, type into the terminal (you must have set up a root account) su echo 66.77.74.20 www.google.com >> /etc/hosts followed by exit. Replace 66.77.74.20 with the relevant IP address by pasting the IP address you obtained from the first step.

[robg adds: This method does quite a bit more than changing Safari's search engine -- it basically re-maps google.com to the search engine you specify through the use of the hosts file. This means that any request for google.com is going to get redirected elsewhere. I'm not aware of any specific Safari-only methods of avoiding google, however -- anyone know more on the subject?]

Comments (17)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030509004243460