Web Development Blog

Twitter

02 Jan, 2008

The easiest method to blocking websites

Web Development » Tutorials » The easiest method to blocking websites

There are many ways to block a website – there are thousands of website filter software available these days, but the easiest way to block an unwanted website without installing any software is by editing hosts file. Yes, that’s right. I only found that out after reading Block Unwanted Websites – by just editing host file blog post on Techie Portal website. I knew about hosts file and I knew how it worked before I discovered the post but it has never come across my mind to use it as a way to block unwanted websites on your computer. Ah the little things that you overlook.

Open HOSTS file which is located at C:/windows/system32/drivers/etc using notepad.

[Screenshot of HOSTS file]

Lets say you want to block www.hityou.com

Just add 127.0.0.1 www.hityou.com as shown in the image above. You may also add the site without the www. for added safety.

Thats it !!! Now when you try to open the website, your browser will be unalbe to connect to this website because the DNS for the website has been changed to 127.0.0.1 instead of the real DNS.

To find out more about how to block unwanted sites by editing hosts file, check out the original post.

Technorati Tags: , , ,

Other similiar posts that you might be interested in:

7 Responses to "The easiest method to blocking websites"

1 | Melissa

January 24th, 2009 at 9:57 am

Avatar

I tried your method but when I click save it says that it can’t and to make sure the path is correct. I can’t figure out how to get it to save my chances without that message coming up. Any thoughts on what’s wrong?

2 | Chuck

February 3rd, 2009 at 3:10 pm

Avatar

Hey, i tryed doing this but only some websites get blocked not all of them! :(

3 | wojtekm

September 22nd, 2009 at 9:49 pm

Avatar

1) u have tyo have admin access to save this file
2)
u have something wrong with your syntax
make sure u added both http://www.website.com and website.com ie:

127.0.0.1 http://www.100888290cs.com
127.0.0.1 100888290cs.com

4 | elai

September 23rd, 2009 at 11:56 am

Avatar

I’ve tried but it didn’t block any website, does it work on googlechrome and Firefox?
I did just the way it’s explained here……….

can you solve the prob please?

5 | eisabai

September 24th, 2009 at 10:26 am

Avatar

Hi elai. This solution is not browser-dependant. However, as wojtekm said, you need to have administrator right on the computer to save the file. And please make sure the syntax is correct and you have entries for both with www and without.

6 | Martin Sandbach

November 17th, 2009 at 7:46 am

Avatar

I see others have commented about having admin rights. One step I still see missing is after editing the hosts file you must close and reopen all your browser windows for the changes to take affect. I also make a point and click instructional video on how to complete the steps in this blog. The video can be found here.

http://helpviavideo.com/watch.php?vidid=37

Comment Form

ebook
Subscribe to our newsletter and receive FREE e-book "7 Days Exercise to Build More Traffic To Your Blog"
Your name:  
Your email:  

  • About
    The blog Web Development Blog is where I keep myself up to date with the latest technologies in the industry and share my ideas and thoug...
  • Adsense Tips and Tricks
    With personal and commercial blogs, community websites, and social pages becoming the hot topic of the Internet in the last few years, many...
  • Advertise With Us
    Web Development Blog is a blog about Web Development, Web Design, Web Applications, Web 2.0, AJAX, Search Engine Optimisation, Latest Techno...
  • Archive
    Grab yourself a cup of coffee or tea, sit back and browse through an archive of all the blog posts on Web Development Blog....
  • Choosing a Content Management System
    The most commonly asked question when it comes to Content Management System is whether to build or buy (pre-built). While there are many fa...
  • Coupons
    Use the following coupon codes, promos and discount codes to save money on web hosting, domain names, website templates, ebooks, software, p...
  • Customised WordPress Themes
    If you would like a customised WordPress theme for your blog or your website, read on: (or head to WordPress Themes page to get free WordPre...
  • Favourite Poems
    If by Rudyard Kipling If you can keep your head when all about you Are losing theirs and blaming it on you, If you can trust yourself w...
  • Favourites
    Books Web Development Books Magazines Glamour Reader's Digest Software Adobe Photoshop CS4 Trend Micro Antivirus + Antispyw...
  • How to Start a Blog?
    What's a blog? According to Wikipedia, a blog is a user-generated website where entries are made in journal style and displayed in a reve...
  • Introduction to JSP Standard Tag Library (JSTL Basics)
    Tag libraries to include in your .jsp page <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> &l...
  • Links
    Free Anonymous Proxy Increases your privacy and security on the Internet by using our free, fast and easy to use web proxy. data backu...
  • Making a Passive Income Online
    Passive income, in my opinion, means an income which does not require a lot of regular maintenance work or continuing effort. I have been t...
  • Online Distribution Channels
    One of the importances of any website or business is to bring your products or services to the right people and to reach the target audience...
  • Recent Projects
    Followings are some of the recent projects I have done in 2006 -- 2007. Check out my latest business venture Web design Sydney to get your...
  • Recommended Web Development Books
    Many developers often ask me what books I read and what books I recommend in regards to web development and web technologies such as AJAX, J...
  • Search
    Looking for something on Web Developement Blog? Use this search tool powered by Google Custom Search to find what you are looking for just ...
  • Seven Tips to Building an Online Presence for your Business
    1. Get a domain name for your business The first and foremost step in building an online presence is to secure a domain name for your busi...
  • Seven Tips to Increasing Your Website’s Traffic Using SEO
    SEO is the buzz word - many people have mentioned it and many have heard of it too, but very few people know how to implement it properly. ...
  • Subscribe
    Newsletter [newsletter] RSS 2.0 feeds Entries feed Comments feed Subscribe using your favourite web-based or desktop feed r...
  • Useful Linux Commands
    Find files older than 60 days find * -mtime +60 Delete files in backup folder which are older than 60 days rm -f `find /backup/ -mtime ...
  • Web Design Tips
    Nowadays, having a website for your business is like having a phone number. Almost every business has their own website, with their own doma...
  • Web Development Books
    Many developers often ask me what books I read and what books I recommend in regards to web development and web technologies such as AJAX, J...
  • Web Hosting Comparison Chart
    The following are some of the most popular web hosting providers. I have personally used the recommended ones. Hosting coupon codes will ...
  • Web Standards
    Web Standards is defined as a set of rules or specifications that should be followed when developing a website.  The main objectives o...
  • WordPress Themes
    All WordPress themes are designed and coded by esn studio, and licensed under GPL license. If you would like a customised WordPress theme fo...
  • Sam: Useful. I always forget the rel target one
  • Chronic Tinnitus: Hi, Thanks for taking the time to discuss a really confusing matter - I find Plesk so much more awkward than the cpanel that I'm used to. Thanks Chr
  • Serhiy: I personally liked the web hosting comparison chart. Especially the recommended *. I got Bluehost :) .-= Serhiy´s last blog ..

Interests

Web development, Web design, Open source technologies, Portal development, APIs, Web services, Social media applications, Search engine optimisation, Mobile application development, iPhone Apps, Web 2.0, Web 3.0, Latest Internet technologies

Misc.

  • bluehost Hosting $6.95/month
  • Joomla Templates