Find the answer to your Linux question:
Results 1 to 3 of 3
My /etc/hosts file contains the following: ----------- # 127.0.0.1 localhost # Blocking 127.0.0.1 facebook.com 127.0.0.1 facebook.net 127.0.0.1 fbcdn.com ----------- In a terminal, when I ping, tr, etc. to facebook.com, it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    13

    Question Host file ( /etc/hosts ) not working right or I'm confused.


    My /etc/hosts file contains the following:
    -----------
    #
    127.0.0.1 localhost
    # Blocking
    127.0.0.1 facebook.com
    127.0.0.1 facebook.net
    127.0.0.1 fbcdn.com
    -----------

    In a terminal, when I ping, tr, etc. to facebook.com, it does appear the host file is working correctly as it shows resolving to 127.0.0.1.

    However, if I attempt to surf to facebook.com in a browser (Firefox, Opera, and konqueror) the page pulls up fine and my firefox IP plugin shows it resolves to 69.171.229.16.

    Can someone explain what's going on here?

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    An entry in the hosts file will not block an entire domain.
    So an entry for domain dot com will not affect host1 dot domain dot com
    or host2 dot domain dot com.

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Also make sure your browser is not using a proxy, but rcgreen's post is likely your problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •