HOSTS file on 10.7.2

Discussion in 'Mac OS X Lion (10.7)' started by packt, Oct 12, 2011.

  1. packt macrumors newbie

    Joined:
    Oct 12, 2011
    #1
    Does anyone know how to get the HOSTS file in "/etc" working with 10.7.2?

    I use a list of domains in the HOSTS file to block adverts and it worked fine until I updated to 10.7.2 when it stopped recognising any of the domains.

    I've tried replacing the file and editing it but my browser doesn't seem to block anything I put in there.
     
  2. r0k, Oct 12, 2011
    Last edited: Oct 12, 2011

    r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #2
    I have some entries in my /etc/hosts file for servers and printers with static IPs and it still works fine in 10.7.2. I don't have that extremely long list of blocks all set to 127.0.0.1 that I've seen going around the 'net. I rely on adblock and flashblock in my browsers and they do well enough for me.

    Darn. I just remembered. There is an etc/hosts but it seems to be ignored. I also have a /private/etc/hosts that just happens to have all my local server stuff too. I must have found and fixed it a long time ago and forgot its location. I doubt that doing anything to /etc/hosts will have any effect.

    You need to edit /private/etc/hosts.
     
  3. bluntmike macrumors newbie

    Joined:
    Oct 13, 2011
    #3
    I had the same problem this morning after installing 10.7.2

    I tried moving my hosts above the first ipv6 entry, also tried adding whitespace to the foot of the file. Moved all my custom hosts to the very top of the file, to just below the ipv4 localhost entry but still above the ipv6 entry and back to the bottom again. None of this worked.

    I have now installed Macports and DNSMasq and am using 127.0.0.1 as my DNS server - DNSMasq looks at your hosts file so there's no need to create zonefiles if you go this method, it just seems to "re-link" the hosts file so it works as it is supposed to.

    I followed the guide on this URL: http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/

    The updates mentioned on that page didn't work for me - only the original solution of installing DNSMasq with Macports

    PS: @r0k - editing /private/etc/hosts didnt work for me either.
     
  4. dijonemon macrumors newbie

    Joined:
    Jul 28, 2011
    #4
    /etc/ is a symbolic link to /private/etc/, so they are the same file.
     

Share This Page