Blocking Certan Websites on Firefox

GenMarshall

High Elven ISB Capt & Ghost Agent
Joined
Jun 17, 2002
Messages
44,443
Location
Night Haven, Vekta, United Systems of Arathor
A question, is there a way in Firefox to block certan websites from being accesed?

Thanks

PS. I will accept any links if there are any 3rd party programs to do this if it is not possible in Firefox.
 
You can use the hosts file in Windows << recommended, as it's a feature of Windows and the least bloated solution.

Not 100% sure FireFox is bound to it, but still confident, because it presumably uses Windows networking API. In WinXP, you would find hosts file at C:\WINDOWS\system32\drivers\etc. Edit it with NOTEPAD while logged in with adminstrator rights.

You may also be able to use a firewall, such as the one included with WinXP, or the network routing feature in all versions of Windows NT.

There are also 3rd party privacy tools such as WebWasher (recommended, free, lots of features) which I think is published in association with Seimens.


To determine an IP address: Goto Start > Run > Command.

Then type ping followed by the URL. The resulting output will display the IP address of that site. For example:
ping civfanatics.net
Pinging civfanatics.net [216.40.216.207] with 32 bytes of data:
 
@Stormbind - Do you have any special instructions when mucking around in C:\WINDOWS\system32\drivers\etc? Since I dont want to be messing around with a file that is a critical OS file.
 
Yes. If you go less than 50 miles per hour when editing that directory, YOUR COMPUTER WILL EXPLODE!
 
Microsoft included instructions at the top of the hosts file :)

Every line beginning with # is just a comment. The computer ignores these lines.

This is what a hosts file might look like. It is possible that entries have been added by applications, but normally it's very short.
Code:
# 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
216.40.216.207	civfanatics.net

To block civfanatics.net I would redirect requests to 127.0.0.1 (false address) which looks like the following. It's just a tab space between columns.

Code:
# 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
127.0.0.1	civfanatics.net

I added instructions for determining an IP address to my first reply - but that isn't needed. It's the early hours of morning and I'm not thinking too quick ;)
 
Is the host file named "lmhosts.sam"?

Since some how I am not getting it to work. Here is what I have and Gamecatcher.net is the site I want to block.

Code:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample LMHOSTS file used by the Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to computernames
# (NetBIOS) names.  Each entry should be kept on an individual line.
# The IP address should be placed in the first column followed by the
# corresponding computername. The address and the computername
# should be separated by at least one space or tab. The "#" character
# is generally used to denote the start of a comment (see the exceptions
# below).
#
# This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
# files and offers the following extensions:
#
#      #PRE
#      #DOM:<domain>
#      #INCLUDE <filename>
#      #BEGIN_ALTERNATE
#      #END_ALTERNATE
#      \0xnn (non-printing character support)
#
# Following any entry in the file with the characters "#PRE" will cause
# the entry to be preloaded into the name cache. By default, entries are
# not preloaded, but are parsed only after dynamic name resolution fails.
#
# Following an entry with the "#DOM:<domain>" tag will associate the
# entry with the domain specified by <domain>. This affects how the
# browser and logon services behave in TCP/IP environments. To preload
# the host name associated with #DOM entry, it is necessary to also add a
# #PRE to the line. The <domain> is always preloaded although it will not
# be shown when the name cache is viewed.
#
# Specifying "#INCLUDE <filename>" will force the RFC NetBIOS (NBT)
# software to seek the specified <filename> and parse it as if it were
# local. <filename> is generally a UNC-based name, allowing a
# centralized lmhosts file to be maintained on a server.
# It is ALWAYS necessary to provide a mapping for the IP address of the
# server prior to the #INCLUDE. This mapping must use the #PRE directive.
# In addtion the share "public" in the example below must be in the
# LanManServer list of "NullSessionShares" in order for client machines to
# be able to read the lmhosts file successfully. This key is under
# \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
# in the registry. Simply add "public" to the list found there.
#
# The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
# statements to be grouped together. Any single successful include
# will cause the group to succeed.
#
# Finally, non-printing characters can be embedded in mappings by
# first surrounding the NetBIOS name in quotations, then using the
# \0xnn notation to specify a hex value for a non-printing character.
#
# The following example illustrates all of these extensions:
#
# 102.54.94.97     rhino         #PRE #DOM:networking  #net group's DC
# 102.54.94.102    "appname  \0x14"                    #special app server
# 102.54.94.123    popular            #PRE             #source server
# 102.54.94.117    localsrv           #PRE             #needed for the include
#
# #BEGIN_ALTERNATE
# #INCLUDE \\localsrv\public\lmhosts
# #INCLUDE \\rhino\public\lmhosts
# #END_ALTERNATE
#
# In the above example, the "appname" server contains a special
# character in its name, the "popular" and "localsrv" server names are
# preloaded, and the "rhino" server name is specified so it can be used
# to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
# system is unavailable.
#
# Note that the whole file is parsed including comments on each lookup,
# so keeping the number of comments to a minimum will improve performance.
# Therefore it is not advisable to simply add lmhosts file entries onto the
# end of this file.

127.0.0.1     www.Gamecatcher.net
 
The name is hosts without file extension.

You can open NOTEPAD and drag hosts into it. I just tested it on my PC and it's not working - think there's a DNS option to uncover..

Edit: Yup, fixed it here. Works 100% with FireFox! DNS order might need correcting but that depends on your system so we will discover whether it's an issue later.
 
Im confused now, I dont think I have hosts in my etc directory. Just "lmhosts.sam"
 
Not a problem (I hope - lol). From that window, go to:

Tools > Folder Options.. > View > Hidden files and folders

Select "Show Hidden Files and Folders". OK. You should now see a hosts file.

Edit: No, that's not it! I cannot get my hosts file to disapear, so I don't know why your's isn't visible :(

Edit #2: Currently suspect spyware has deleted it.
 
stormbind said:
Not a problem (I hope - lol). From that window, go to:

Tools > Folder Options.. > View > Hidden files and folders

Select "Show Hidden Files and Folders". OK.

You should now see a hosts file.
Erm, I did that and I still dont see it.

Edit: Nevermind, Ive created a new notepad file there and added the site.

Thanks for the help, it certanly worked. I keep getting the connection was refused message (which is telling me I did it right)

Edit 2: Nevermind about edit #1. Apperently that did not worked :(.
 
I know. I just edited my post :(

I'm fairly sure it's safe (99.9%) to make a new text file, edit it as though it were a hosts file. Save. Rename it to hosts.

Suspect spyware deleted it. After creating the file, try using "read-only" to prevent it being deleted again.
 
stormbind said:
To block civfanatics.net I would redirect requests to 127.0.0.1 (false address) which looks like the following. It's just a tab space between columns.
To be exact, 127.0.0.1 isn't actually a false address; it actually refers to the computer itself. Assuming you're not running a web server on your computer, any connection to 127.0.0.1 will be rejected, with the effect of it acting as a false address. You can also use 0.0.0.0 (if I remember correctly...), which refers to a false address rather than the computer itself.
 
The whole point of this type of blocking is to prevent certain websites opening pages you don't want. If you just don't want to visit a site then don't go there.
 
anarchywrksbest said:
The whole point of this type of blocking is to prevent certain websites opening pages you don't want. If you just don't want to visit a site then don't go there.
Another use for it is to block advertising sites like Doubleclick, which allows pages to load faster (since you don't have to wait for the ads to load). Of course, in Firefox, the Adblock extension is better suited for this purpose, but in IE, the hosts file can be useful for adblocking.
 
Chairman Meow said:
Another use for it is to block advertising sites like Doubleclick, which allows pages to load faster (since you don't have to wait for the ads to load). Of course, in Firefox, the Adblock extension is better suited for this purpose, but in IE, the hosts file can be useful for adblocking.

That is also true. But what CivG is doing can also be done using willpower.
 
There is a problem with all of this if you can use other computers to access the site. I have access to more than one computer when accessing the internet.

However it may still be beneficial if it at least puts another block in the way so that if willpower fails the website cannot be immediately accessed. I don't feel there was any need to mention the site you were blocking though...
 
You can use Adblock to block such undesirable websites. Just enter the url in to the textbox. And be sure to turn on site blocking under Adblock preferences.
 
Back
Top Bottom