HOSTS file question

Discussion in 'macOS' started by steven.s, Sep 19, 2009.

  1. steven.s macrumors newbie

    Joined:
    Sep 19, 2009
    #1
    I'm new to Mac so please be gentle! :)

    I've just added a couple of entries to my HOSTS file to test whether it works the same way in Mac OSX (SL) as it does in Windoze.

    I've found it does... and it doesn't.

    My 4 test entries are totally blocked if I use Safari, but they're NOT blocked in Firefox.

    Could someone tell me in simple terms why this is so, and if there's something I can do to make Firefox obey the HOSTS redirects?

    Thanks!
     
  2. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #2
    If I edit my /etc/hosts file so it looks like this:

    Code:
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1	localhost
    255.255.255.255	broadcasthost
    ::1             localhost 
    fe80::1%lo0	localhost
    
    207.17.137.239	cisco.com
    Anytime I go to "cisco.com" in my browser, Firefox or Safari, I go to Juniper's home page.

    How are you modifying the "/etc/hosts" file and what are you seeing different between Firefox and Safari?

    S-
     
  3. steven.s thread starter macrumors newbie

    Joined:
    Sep 19, 2009
    #3
    Hi Sidewinder,

    My hosts file looks just like yours, except the last couple of lines are like:

    127.0.0.1 www.website.com
    127.0.0.1 domain.com

    If I try to visit www.website.com or http://domain.com in Safari, I get a "can't get to this website" message, as expected.

    In Firefox, I get the websites!

    Steve
     
  4. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #4
    Why use the loopback address? I would expect strange results using that address. For a while I could get both browsers to work using that address. Then both failed.

    Use something other than the loopback address.

    S-
     
  5. steven.s thread starter macrumors newbie

    Joined:
    Sep 19, 2009
    #5
    Sidewinder,

    Thanks!

    I used the loopback address because that's what I've always used in Windoze (!) and it was also used in a Mac forum example I found...

    However, I replaced the loopback address with your Juniper IP address and all is well.

    So many thanks.

    :) Steve
     

Share This Page