Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arogge

macrumors 65816
Original poster
Feb 15, 2002
1,065
33
Tatooine
With OS X, this is something so simple that doesn't "just work". :( On one system, I copied my hosts file to /etc and made another file named "hosts" in my user's home directory with one line: "LookupOrder Cache NI FF DNS DS". This changes the order in which OS X looks for server addresses. This configuration is working, and it was simple. :) Now I'm trying this with another Mac system and it doesn't work. It's possible that I forgot about some command I had entered on the system that is working. I looked on the Web, but there are so many different and incompatible ways of using a hosts file, and I want to use the method that is already working on the first system. Is there a command missing?
 
Re: Using hosts file with OS X

Originally posted by arogge
... It's possible that I forgot about some command I had entered on the system that is working. I looked on the Web, but there are so many different and incompatible ways of using a hosts file, and I want to use the method that is already working on the first system. Is there a command missing?

Yes, Mac OS X does not use /etc/hosts by default. You can enter the hostnames in netinfo (in Applications/Utilities); I think there is also a way, in there, of telling it to use /etc/hosts.
 
I finally got the ad-blocking hosts file to work on my PowerBook. I believe that the problem was a missing line entry:

127.0.0.1 localhost
::1 localhost

Once that second line was read, the system correctly redirected all traffic to the entries in "/etc/hosts". This is very useful because the obnoxious Internet advertising can make many Web sites unusable. On my slow connection, one animated ad from ar.atwola.com can take more than two minutes to download. :eek: When I'm paying for each minute of connectivity, that's not good. These advertisers must assume that everyone has broadband connections. :rolleyes: Well, it's working now and I can finally connect the laptop to the Web and get to the sites I want without being hassled by advertisers. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.