When you type a domain name into your Web browser, Internet Protocol contacts a computer that is a domain name server to look up the IP address of the Web site. In the early days, the Internet didn't need domain name servers.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

[About BTH]  [User Agreement]  [Privacy Policy]  [Site Map]  [Contact Form]  [Advertise on BTH]  [News Feed]

Google
Web
This Site

Use the HOSTS File to Block Web Sites

When you type a domain name into your Web browser, Internet Protocol contacts a computer that is a domain name server to look up the IP address of the Web site. In the early days, the Internet didn't need domain name servers. Every computer had a file named HOSTS that listed the domain name and IP address of the systems connected to the Internet.

Looking for a reliable hosting network? We have email hosting that is perfect for your e-mail needs. Try out our microsoft exchange server or we also have outlook exchange!

Even today when your Web browser needs to resolve a domain name to an IP address, it first looks for a file named HOSTS on the local computer. In Windows NT, the HOSTS file is located in c:\windows\system32\drivers\. In Windows 9x, the HOSTS file is located in c:\windows\.

Because the HOSTS file is no longer required, you may not find it on your computer. Instead, you might find a file named HOSTS.SAM, the SAM extension meaning "SAMPLE". You might also find a file named LMHOSTS. The LMHOSTS file was used to resolve NetBIOS names to IP addresses.

The HOSTS file is simply a text file with a list of IP addresses and their respective domain names. You can open the file with Windows Notepad. The HOSTS file may list only one IP address, the loopback address, as shown below.

127.0.0.1 localhost

To block a Web site, enter an IP address that is not allowed for the Web. For example, any IP address with the first digit of 0 would be on the local network. Any IP address with the first digit of 127 is looped back. Then map that IP address to the domain name that you want to block.

For example, suppose you want to block a porn site that your teenager has been visiting, you might add an entry like the one shown below.

127.0.0.2 www.pornsite.com

Banner ads are usually hosted on an advertiser's domain and linked to sites all over the Web. Suppose you want to block annoying banner ads displayed at a site that you visit frequently. You might add an entry like the one shown below.

127.0.0.3 www.adserver.com

Then when a file from that domain name is requested, instead of the porn site or the banner being displayed, the browser will display the message "The Page Cannot be Displayed".

When you save the HOSTS file after editing, make sure that the file name does not have an extension. Sometimes Windows Notepad adds the extention .txt.

The HOSTS file is a quick, easy way to block access to a Web site. But if you use this method to block a porn site that your teenager has been visiting, make sure they don't find this article.

Computer Sections

RSS Feed RSS Feed

Windows System Administration
Security Risks and Ways to Decrease Vulnerabilities in a 802.11b Wireless Environment
Configure Vista's Data Execution Prevention
Internet Connection Sharing in Windows XP
How to Backup Mails and Address Book of Outlook Express
Windows 2000 Security Overview
Kill The Messenger (Service)
Use the HOSTS File to Block Web Sites
FreeDOS
A Day in the Life of a System Administrator
Microsoft Licensing Explained
Configure Windows Indexing Service for Performance
Configuring Windows as a NTP (Network Time Protocol) Server
Font Basics
Three Important Techniques for Securing a Wireless Network
Defend Your Business with a Firewall
Msconfig - Microsoft's Secret Weapon to Increase Your Computer's Speed
Choosing a Tape Drive
PC Technician Certifications and Professional Organizations
PC Technician's Guide to Providing Telephone Support
PC Technician's Software Copyright Responsibilities
CompTIA A+ Complete Study Guide
Hard Disk Management
Windows Server 2003 Active Directory and Network Infrastructure
The Security and Maintenance of Messages in Outlook Express
Planning a Backup and Restoration of Files for Disaster Recovery
WSH to Master Your Computer
Script to Print a Directory File List
Disable Long Filenames to Improve Window's Performance
Disable Kernal Paging to Speed Up Windows
Script to Display the Processes Running on a Computer
Script to Identify Your Systems HAL
To Protect Your PC Disable the Windows Scripting Host

[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyright©2001-2007 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269