Results 1 to 2 of 2
  1. #1
    Joined
    Mar 2003
    Location
    Dallas, Tx
    Posts
    1,766

    Help with editing my HOSTS file

    Hi all,

    I'm trying to add some sites to my HOSTS file to block (p0rn sites), but every time after I save it, it still lets me access the site. Lets say, for example, I wanted to block www.abcd.com and www.xxx.com, isnt this what my HOSTS file should look like:

    # Copyright (c) 1993-1999 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    # 102.54.94.97 rhino.acme.com # source server
    # 38.25.63.10 x.acme.com # x client host

    127.0.0.1 localhost
    www.abcd.com abcd
    www.xxx.com xxx
    That's what I have done for these sites Im trying to block, but no luck. Am I not supposed to just put the URL in the first column? Does it matter what u put in the 2nd column?? Any help would be greatly appreciated.
    Last edited by Mjölnir; 04-04-2007 at 12:20 AM. Reason: Removed URL parsing
    Opty 146 0540FPMW @ 3.0ghz
    300x10, 2.5-4-3-7, 2.7vdimm
    DFI Lanparty NF4 Ultra-D
    2x512mb OCZ Platinum Rev.2 TCCD
    ATi X1800XT 512MB
    Fortron 530w w/ modded rails
    Zalman 7000-AlCu

    MY HEATWARE

  2. #2
    Joined
    Jul 2003
    Location
    Australia
    Posts
    14,223

    Re: Help with editing my HOSTS file

    You need to redirect them to the loopback address (127.0.0.1 - which is your own PC). You also need to include a hash (#) in front of your comments so that when the HOST file is parsed, it ignores all text (on the same line) beyond the redirect IP and the domain to be redirected:

    Code:
    127.0.0.1 localhost
    127.0.0.1 www.abcd.com #abcd
    127.0.0.1 www.xxx.com #xxx
    You might also like to check out this HOSTS file site:
    http://www.mvps.org/winhelp2002/hosts.htm

    Last edited by Mjölnir; 04-04-2007 at 12:24 AM.

Posting Permissions

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