- Aug
- 1,821
- 59
I use the latest version of FireFox, and have installed add-ons to block un-desirable content from the Internet. The add-ons Adblock Plus, Flashblock, Ghostery, and ProCon Latte do a great job of blocking un-desirable content from the Internet.
Microsoft Security Essentials provides great protection from viruses and such, and having un-desirable sites blocked in the hosts file is another part of securing my XP system.
I also keep my hosts file up-to-date with the latest threats via the MVPS Hosts updates. Using HostsMan allows me to update my hosts file, without losing sites that I have manually added to my hosts file.
With all of this security, there are still un-desirable sites that do get through
A FireFox addon, ShowIP, displays the IP address of the site that is being viewed in FireFox. Left clicking on this IP address pops up a menu, showing the host for the site being viewed. Directly underneath it is the option to copy this host to the clipboard.
To block this site for my system, regardless of what browser, program, or CLI I am using, I add the site to my hosts file. The following is a batch file that I have written to do this.
I have also added a button to the Take Command Toolbar, that I can click after switching from FireFox, that will execute the batch file, with the command c:\utils\a2h.btm enter
As I still use XP, the location of your hosts file may be different if you use Vista or Windows 7.
While there may be other solutions, this is a quick way to add the name of a host to your hosts file, so that it is immediately blocked on your system. If, in the future, you want to unblock this site, simply edit your hosts file, and remove the line from the file, or precede the line with a #.
Joe
Microsoft Security Essentials provides great protection from viruses and such, and having un-desirable sites blocked in the hosts file is another part of securing my XP system.
I also keep my hosts file up-to-date with the latest threats via the MVPS Hosts updates. Using HostsMan allows me to update my hosts file, without losing sites that I have manually added to my hosts file.
With all of this security, there are still un-desirable sites that do get through
A FireFox addon, ShowIP, displays the IP address of the site that is being viewed in FireFox. Left clicking on this IP address pops up a menu, showing the host for the site being viewed. Directly underneath it is the option to copy this host to the clipboard.
To block this site for my system, regardless of what browser, program, or CLI I am using, I add the site to my hosts file. The following is a batch file that I have written to do this.
Code:
::
:: Add a host name to the hosts file,
:: in order to block that host.
::
:: Written using
:: TCC 11.00.52 Windows XP [Version 5.1.2600]
:: TCC Build 52 Windows XP Build 2600 Service Pack 3
::
:: Joe Caverly, January 2001
::
@echo off
set hosts=C:\WINDOWS\system32\drivers\etc\hosts
echo Searching %hosts file for %@clip[0]
ffind /t"%@clip[0]" %hosts > nul
if %_? eq 2 goto notfound
echo %@clip[0] already exists in hosts
goto eoj
:notfound
::Ensure that this is a good IP Name
if %@count[.,%@clip[0]] eq 0 goto badname
if %@ipaddress[%@clip[0]] eq 11001 goto badname
::
:: You may need to add further checking,
:: depending on how you use your hosts file.
::
echo Adding %@clip[0] to hosts file
echo 127.0.0.1 %@clip[0] >> C:\WINDOWS\system32\drivers\etc\hosts
echo %@clip[0] is now blocked
goto eoj
:badname
echo (%@clip[0]) is a bad IP Name
:eoj
As I still use XP, the location of your hosts file may be different if you use Vista or Windows 7.
While there may be other solutions, this is a quick way to add the name of a host to your hosts file, so that it is immediately blocked on your system. If, in the future, you want to unblock this site, simply edit your hosts file, and remove the line from the file, or precede the line with a #.
Joe