Search in uioop.blogspot.com

Blog Archive

Thursday, June 21, 2007

How do I block websites with hosts

Open a DOS command window, type:
notepad C:\WINDOWS\system32\drivers\etc\hosts

Windows Vista = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows XP = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K = C:\WINNT\SYSTEM32\DRIVERS\ETC
Win 98/ME = C:\WINDOWS


Put the following line in hosts:
127.0.0.1 www.google.com

File > Save.

Now try to open http://www.google.com with any web browser on the PC.

Remove the line you added from hosts to restore access to the Googl;e
web site

Editors Note: in most cases a large HOSTS file (over 135 kb) tends to slow down the machine. This only occurs in W2000/XP/Vista. Windows 98 and ME are not affected.

To resolve this issue (manually) open the "Services Editor"

  • Start | Run (type) "services.msc" (no quotes)
  • Scroll down to "DNS Client", Right-click and select: Properties
  • Click the drop-down arrow for "Startup type"
  • Select: Manual, or Disabled (recommended) click Apply/Ok and restart. [more info]

When set to Manual you can see that the above "Service" is not needed (after a little browsing) by opening the Services Editor again, scroll down to DNS Client and check the "Status" column. It should be blank, if it was needed it would show "Started" in that column. There are several Utilities that can reset the DNS Client for you ... [more info]

Editors Note: The above instructions are intended for a single (home-user) PC. If your machine is part of a "Domain", check with your IT Dept. before applying this work-around. This especially applies to Laptop users who travel or bring their machines home. Make sure to reset the Service (if needed) prior to connecting (reboot required) to your work Domain ...

JBF sends along this Tip: IPCOP running a DHCP server needs the local PC DNS Client enabled to function.

Reset the DNS Client with a simple batch file (submitted by: Ronny Ong - 2K/XP only)

DnsManual.bat (resets the DNS Client to Manual) [right-click and select: Save Target As]
DnsDisabled.bat (resets the DNS Client to Disabled) [right-click and select: Save Target As]
To use: double-click on the downloaded file and reboot that's it ...




http://www.mvps.org/winhelp2002/hosts.htm

No comments:

AVG Internet Security 2013

Total Pageviews

Contributors