Using hosts file with OS X

Discussion in 'Mac Apps and Mac App Store' started by arogge, Nov 18, 2003.

  1. arogge macrumors 65816

    arogge

    Joined:
    Feb 15, 2002
    Location:
    Tatooine
    #1
    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?
     
  2. cubist macrumors 68020

    Joined:
    Jul 4, 2002
    Location:
    Muncie, Indiana
    #2
    Re: Using hosts file with OS X

    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.
     
  3. arogge thread starter macrumors 65816

    arogge

    Joined:
    Feb 15, 2002
    Location:
    Tatooine
    #3
    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. :)
     

Share This Page