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.


dude i need help..it doesnt work for me..i mean when i follow the steps they’re okay but when i save it, a pop up screen shows that i should make the file name and path name correct..also instead of 127.0.0.1 etc appearing, its ::1 that appears..help me out please..thanks..really appreciate it
hi rakshitk,
nice one, i’ve done it and it works. tnx.
question: can you teach me how to view private photos in friendster?
hope you could help me.
In order to save, make sure you are doing this as an administrator.
@rakshit
it,s not working on my Google chrome
it worked nicely for some website but not working for http://www.agame.com. any ideas??
hello sir, can you help me to block the site of other computer in a network without knowing the user of it.thnxxxxxxxxxxx
hi sir i hve problem when continuing above process bc when i open host in notepad it shows nothing like u mentioned above its blank. plz guide me how i block website waiting for ur reply tnks
Sir–
I tried your directions for BLOCKING a site on a single computer(Sorry, I did mean “Blocking” on my previous comment) but could not find any “127.0.0.1 localhost” in my Windows/system 32/drivers/etc folder. (My OS is Windows XP Pro) Instead I have the following list in the “etc” folder:
DsaFlt.cfg
DsaFlt.rls
Idsflt.cfg
Imhosts.sam
NetAR.wlt
NetAv.alt
NetFlt.cfg
networks
protocol
services
smsflt.cfg
Any suggests on how to use your block directions with this list? (Disregard my previous comment about “unblocking” a site).
Thanks,
Chrys
@chrys
Search for file name “host”, inside that file you will find “127.0.0.1 localhost”. It may be hidden as well.
Thank you, Rakshit for the suggestion.
There are a number of files on the intended (targeted) computer with “host” in the name. I did a search on the targeted computer for “127.0.0.1 localhost” but it turned up no such file. However, I tried another computer with XP Pro and it DID have a “host” folder and “127.0.0.1 localhost” file in that folder.
Now, the intended(targeted)computer for the one-site block has only Service Pack 2 installed. But the other computer (with the “127.0.0.1 localhost” file), has Service Pack 3 installed.
Could that be the difference in the absence of that “localhost” file? The difference in Service Packs installed?
Thanks,
Chrys
Chrys,
First of all “hosts” is the name of the file not the folder. Please refer to the screenshot above.
Ok, let’s start from the first step. When you typed
notepad %windir%\system32\drivers\etc\hosts in the run command, were you not able to see the file named “hosts” getting opened in notepad?
If not, then copy the hosts file from other computer to your targeted computer at the location %windir%\system32\drivers\etc
sir i had lost my host file . i deleted my host file . can i regain them.sir plz tell meeeeeeee plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
My family also have a same situation. Lol..
I know what u mean Rakshit. Anyway, thanks. I very helpful sharing..
.-= Peter Jay´s last blog ..Our Very Very Own BRC Toolbar =-.
Good day!
How can i block all website except for 3 website?
Thanks,
Noel
bro it works for me but
he only block one website
how can i block 2 or more webste?
hi! tnx, this is very useful to prevent spread of viruses to my PC,
after i have changed from .0.1- to 0.9, wcan i changed the 2nd to the last no???tnx krakshit, i learned something from you today
hey brothere….. how r u ?? i tried the same thing and saved it properly but dont know why its not working please helpo me out
thanks
.-= Ady´s last blog ..How to Recover Deleted Pictures and Files from Memory Cards =-.
Hey Rakshit
Thanks it worked for me well. Now I want to unlock and its not still opening the site. what do I do to unlock now that my kids are back to school
thanks for information…and nice blog will like 2 visit again
thnx bt it is nt blocking the link of tht web site….suppose it is blocking songs.pk…….thn its nt blocking songs.pk/anjanaanjani/
It dosen’t work by windows 7
It’s really working , and so good Thank u . For giving more information .