HometimeCalendarFAQSearchMemberlistUsergroupsRegisterLog in
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Similar topics
Top posters
Damhieyu
 
Vincent PauL
 
pStarKevS
 
Hero
 
thelinedivides
 
Computer(Easy)
 
eULo
 
Mr.shyvee
 
mayetjohn
 
BlackLabel274263
 
October 2017
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
CalendarCalendar
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

None

Most users ever online was 44 on Tue Apr 25, 2017 1:49 pm
Advertisement

Watch Naruto Online
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
free forum


 

Share | 
 

 Blocking Websites Using the Windows Hosts File

View previous topic View next topic Go down 
AuthorMessage
Damhieyu
Founder
Founder
avatar

Posts : 192
Join date : 2010-04-18

PostSubject: Blocking Websites Using the Windows Hosts File   Sat Jun 05, 2010 3:43 pm

Blocking Websites Using the Windows Hosts File

There are a lot of tools available for blocking ads, removing spyware, scanning for viruses. Most of this unwanted content comes from known ad servers and known malicious websites.

The Windows HOSTS file allows you to block some of this content very easily and for free. However, this is not a complete internet security solution. It is still recommended that you run anti-virus software on your computer and be careful of the websites you visit.


Defining the HOSTS file

The HOSTS file is located in the following locations for the respective versions of Windows:

Windows 7, Windows Vista, Windows XP, Windows Server 2003:

C:\WINDOWS\system32\drivers\etc

Windows 2000:

C:\WINNT\system32\drivers\etc\

Windows 98/ME:

C:\WINDOWS

The HOSTS file does not have an extension, but it is a plain text file. This file allows you to manually associate IP addresses with domain names (i.e., google.com) so the Domain Name Server (DNS) can quickly resolve an address.

To use the HOSTS file to block a website, assign the IP address of 127.0.0.1 to the domain name of known ad servers and malicious websites. 127.0.0.1 is the IP address of your local computer, if you chose to run a server on it.

As an example, let’s say some ad server hosts a banner ad at the URL: http://www.adsite.com/ads/12345.jpg. If you associate this domain name with the IP address of your local computer, 127.0.0.1, when that website tries to load that image, it will not be found because the image file does not exist on your computer. Therefore, the ad will not display on that webpage.

Editing the HOSTS file

Since the HOSTS file is a text file, open the file in Notepad, or other text editor, to edit it. This first line of the HOSTS file should list the local IP address:
127.0.0.1 localhost

That tells the rest of the file that 127.0.0.1 is your local machine, as mentioned above. You could also use 0.0.0.0 instead of 127.0.0.1 — either will work. However, whichever IP address you use for localhost, also use for the sites you want to block.

After the localhost entry, enter known ad servers and malicious websites and assign your local IP address to each domain name. Put the IP address at the beginning of the line, followed by a tab, followed by the domain name for the ad server or malicious website. Here’s an example of the HOSTS file:



NOTE: Some spyware programs automatically add ad servers and malicious websites to your HOSTS file for you.

For Windows XP/2000 users only

In Windows XP and Windows 2000, if your HOSTS file gets to large (over 135 kb), the DNS Client (a system service) will cause problems on your machine possibly causing it to lock up. This service is unnecessary and can be stopped and disabled.

Therefore, before you save a big list of ad servers and malicious websites in the HOSTS file, select Control Panel | Administrative Tools | Services from the Start menu.



Scroll down to the DNS Client service, right-click on it, and select Properties from the pop-up menu.



The DNS Client Properties dialog box displays. Select Manual from the Startup type drop-down list. Click Stop below Service status to stop the service. Click Apply and then click OK.



For more information about the HOSTS file, see http://accs-net.com/hosts/what_is_hosts.html. You can find maintained HOSTS files online or start to build your own. See http://www.mvps.org/winhelp2002/hosts.htm to download a good, free, pre-populated HOSTS file.

There is a .zip file for download containing the HOSTS file, a batch file for easy installation, and a readme file with instructions for installation in the different versions of Windows. Beware that there are special instructions for Windows Vista and Windows 7.

Also have a video on how to use host file

Back to top Go down
View user profile http://spusjsit.niceboard.biz
 
Blocking Websites Using the Windows Hosts File
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Good, successful writer websites?
» Creepy Websites
» Windows 7, squashed images
» All Nokia BB5 MCU PPM CNT Flash File Here By ..::sunny boy::..
» All Nokia BB5 Flash File

Permissions in this forum:You cannot reply to topics in this forum
:: Junior Society Of Information Technology :: :: Computer Section :: .-
Jump to:  

Copyright © 2009-2010 SPUS - JSIT. All rights reserved.
Powered by Forumotion
© phpbb


How to make a forum | © phpBB | Free forum support | Contact | Report an abuse | Forumotion