Many times we need to unblock certain websites to gain access to some important stuffs. We all know many ways to do that. But how about actually learning to block one?
Have you even been in a situation when you have to block certain websites from your computer for any reason? Well, I am not sure about any body else but certainly I have been many times in such situation. Parents may also want to prevent access to certain websites on their computer so that children can’t get to them from internet.
So what’s the solution?
Aaaah… It’s very simple.
1.) Open “Run” from the start menu (or press WinKey + r). Just copy paste the following path and hit ENTER.
notepad %windir%\system32\drivers\etc\hosts
Alternately, go to C:\Windows\System32\Drivers\Etc and find the file “hosts”. Open that file in Notepad.
2.) When this hosts file is opened in Notepad, at the end of the file you will see something like “127.0.0.1 localhost”.
3.) Under “127.0.0.1 localhost” just add another website URL that you want to block.
For Example:-
127.0.0.1 localhost
127.0.0.2 www.rakshitk.com
127.0.0.3 www.whoismadhur.com
4.) Make sure every time you add another website, the last digit of the address 127.0.0.x should not be the same.
5.) Save the file and exit.
So, here you go. Restart your browser if it is opened and changes will take place immediately.
The good thing is that no message, no pop ups nothing will be displayed when someone tries to open a blocked website. Your browser will just fail to open those websites without any error messages.


I’ve been using this tricks for quite some time but primarily not for blocking ads. I added few online game sites. That way, my little brother can’t play online games that affect the network speed. haha
on the other note, you may take a look at this page.It gives big list of ads companies. I always put kontera ads inside the file and remove other companies such as adsense etc. That way you will be able to eliminate text popup from kontera and still able to see other ads.
hahaha.. very intelligent eches. Even I have done something like this. My little sis is almost addicted to orkut and other social sites, so guess what, I have blocked all of them.
The page you provided is very informative.
Thanks buddy for your valuable comments.

very useful! I think I need to add facebook to my hosts list and keep sticky fingers away from my keyboard
Andy Baileys last blog post… CommentLuvvers – Interesting sites that use the CommentLuv Plugin
@Eches,
Maybe your brother is reading this now.
@Rakshit,
Nice tips, we use host file in my office PC for connecting to client machines and databases.
Nirmals last blog post… Freeware: Edit Images with Multi-Layer Support with Photobie
@Nirmal
That’s amazing. Didn’t know about that. Perhaps, after few months when I get into the job, I can explore more about the hosts file usability.
@Andy
Welcome to Aarambh!!!
Well, its really tough to get away from addictions. Keep trying buddy.
Very useful tip including all the comments. This has just solved many problems of mine. Thanks!
Hariss last blog post… Download UXtheme.dll Patch For Windows XP SP3
No problem Haris.
Its good that you find it useful.
nice tip!
[...] Update:- If in case you are looking for a tutorial to actually BLOCK any website on your computer that too without using any software, follow this link. [...]
Welcome to Aarambh, Moin. Hoping to see you more.
Cool! Now what websites should I block?
Steve Yus last blog post… How to Trace and Recover Stolen PC?
This is indeed a tricky one Rakshit..
Manojs last blog post… Convert any File Format Online – youconvertit
Can we block microsoft from accessing our computer or any other daemon site which monitors our system by this way?
I have used your trick..but it is not working with my browser…:)
@Kannan
Nice suggestion. You certainly cannot block microsoft.
Manish
Are you using any proxy server to connect to the internet? This technique does not work with most of the proxy servers
Well, I’ve been using this idea for quite a while, but I simply forgot about it! I’ve got several hundred lines in my hosts file for the purpose of blocking ads. However, one difference is that all of mine link to 127.0.0.1. I’m not quite sure why you say not to have the same .1 at the end. It simply tells the browser to look at this address for the content at that site.
@Mike
Yes, it can also be used for blocking ads.
According to my knowledge, if we use same .1 at the end, it will not able to block the web address mentioned after that. For every site we have to use different last digit.
But as you said, it is working with .1 as well. I have also tried the same. Works perfectly.
Thanks for notifying this.
I want to block some websites on my computer.I have tried the hosts file but its not working,is there that you can tell me about that.Thank you.
hey ! I tried this it works good on IE but not with mozilla Firefox can u guys help me on that ???
Hey Solomon,
It works perfectly fine with Firefox as well. Which version of Firefox are you using?
well i would like to know how to generate traffic to my site and also is can you teach me how to nublock websites because i dont know how to do them and also one more thing,can you also give me details on how to access websites .
thanks
innocent’s last blog post… Essential Elements of a Successful Trader
For generating traffic on your blog, there is one and only million dollar formula. MAKE YOUR CONTENT STRONG AND STRONG ENOUGH SO THAT YOU VISITORS TURN OUT TO BE YOUR REGULAR READERS. Content is KING.
For unblocking websites, visit here.
well,am ok with your answer but i still would like to be tutored on how to have access to a website e.g http://www.mtnonline.com. pls check out this site to see if i can hack into it or have access it and also tell me how.
thanks
innocent’s last blog post… Essential Elements of a Successful Trader
[...] computer … Recognizing and Avoiding Fraudulent Websites Protect your computer with Three free …http://www.rakshitk.com/blog/2008/05/18/how-to-block-websites-without-using-any-software/Blocking Unwanted Parasites with a Hosts FileAnother feature of the HOSTS file is its ability to [...]
Thanks for this. Article which your writen was so important for me. Thanks again
Amazing article! Detailed and very interested. I am going to recommend this blog to my friends.
sorry buddy
i know this
but it doesnot work
i tried this so many times
This is a very nice article Really
Dear Rakshit
I followed this article.It works well,but i am not able to block gmail.
Can u help me out please ?
Regards
Krushna
ive done what it says in the instructions but it just isnt working. trying to block brother playing stupid online games that use up all the bandwith and downloads
I’ve tried this and it isn’t working. I get to where it says save and then I get:
cannot create the C:\WINDOWS\system32\drivers\etc\hosts file
Make sure that the path and file name are correct.
What am I doing wrong and how can I fix this because I really need to do this. Thank you.
this very nice, thank you.
Though it is possible to block sites via hosts file, software slution is way better from security standpoint. http://www.parentalfiltercontrol.com/ lists a few products.
It doesn’t work for me. This keeps popping up:
cannot create the C:\WINDOWS\system32\drivers\etc\hosts file
Make sure that the path and file name are correct.
help
HOSTS file is not always in that File guys do a search for HOST file make sure you SAVE with out an extension.
HOST. works HOST.TXT does not work. notepad likes to add the .txt
127.0.0.1 is the local machine and localhost is the url name to itself. SO
localhost 127.0.0.
i will try this method in office. can u tell me it’s work in server or not
A good and interesting read, thank you.
Thank you – I’ll be sure to check back later for more of your posts.
I worked for me… Thanks for the nice tip…
If you ever want to see a reader’s feedback
, I rate this article for 4/5. Decent info, but I have to go to that damn yahoo to find the missed bits. Thank you, anyway!
I found that you can even disable live messenger with that method… Works great for office computers
It really amazing instruction….
cause am going to do this action with my little Brother who’s going to have Exam the next view weeks cause he always west his time playing games
thankz alot agian
hey I have tried doing that and there are a few sites that still do not block.so how do i do that?and also google searchs for the sites still show up too
http://postnext.com/ will not block at all
Hijackthis was just about the best tool for software troubleshooting . . . but now that trendmicro bought it; I worry.
Wow that’s actually a simpel method. I never thought of that way. Always using the router to block a single website. Thanks for the tip guy’s
it will not let me save the changes. Says make sure the file path and name are correct. Suggestions?
Hi kristy,
You are probably using Windows Vista. What you need to do is the following:
right click on the hosts file. In the dropdown menu go to properties then go to the security tab. There you see a couple of group/user names. Select the group users. Below you see the security settings for this group. Click to select the full control permissions. Then click apply and edit your hosts file. After your done editting follow these steps again to uncheck the full controll permissions. For security reasons.
Thanks, if you’re bored visit my site
Does this work in Vista?? I followed the directions above and got unable to create C:\Windows\System32\Drivers\Etc\hosts. How do I block websites in vista??
Thanks.