Summary: There are ways to block URLs in IE, but doing so will block them from all other programs as well.
|
Is there a way to block certain URL's in IE? |
Actually, there is, yes. But when you do it, you'll be blocking them in IE and any other program that might attempt to access them.
Interestingly enough, it's the same technique that some viruses use to block you from getting to anti-virus sites.
•
Normally Windows uses what's called DNS to map a domain name, such as "microsoft.com" to an IP address, like "207.46.130.108". It's easier for you and me to remember domain names, and this also allows the domain name owners to change their internet addresses at will.
The "hosts" file is a plain text file that can contain overrides to DNS. In it you can hard-code the IP addresses that domain names will map to. Normally, it's not used at all, but it's a great opportunity to block access to domains you don't want accidental access to.
The hosts file is typically found in "c:\windows\system32\drivers\etc\hosts". You may need to change the file's read-only attribute so that you can make changes. Open it in notepad.
You should notice an entry like this:
127.0.0.1 localhost
That defines the IP address of "localhost" to be 127.0.0.1, which by definition is your own machine.
To block a site, just add a similar entry to the end of the file. For example:
127.0.0.1 www.badsite.com
Now "www.badsite.com" is mapped to your machine. Since you're probably not running a web server, any attempt to visit that site using a browser will fail. In fact, ANY attempt to use "www.badsite.com" will get directed to your own machine and will typically fail.
The only caveat is that addresses are often cached by the software. That means you may need to exit all instances of your browser, for example, before the blockage becomes apparent. In the worst case, reboot, and it should take effect.
By the way, if you open the hosts file and find a long list of what look like anti-virus site domains, you've been infected by a virus and probably want to scan as soon as possible. And feel free to delete those entries from the file.
Article C2110 - July 10, 2004
Leo is perfectly correct all he has said here. But who are saying its not working make sure you typed 127.0.0.1 (spance here) www.badsitename.com.
Without space it won't work.
And the message it cannot create the file, and to make sure the path and file name are correct: is shown because the file hosts is being accessed by another process (may be your antivirus). If so then first disable antivirus then try to change the file again. Hope, you'll able to do this time.
But Leo I need a little bit more expand with that. Suppose I want to redirect all subdomains of the site badsitename.com. e.g, blog.badsitename.com, www.badsitename.com. webmail.badsite.com etc. Then without writing all these can I do this just by this kind of trick:
127.0.0.1 *.badsitename.com
Another issue: If someone tries with the ip address of the badsitename.com he can easily enter the site because we are redirecting during domain name to ip conversion processing. What is solution if I also want to redirect if someone tries with the ip address of the site.
Thanks leo very much.
Thanks Leo.
For sites that have dedicated servers, there's no way to block direct-IP address. The good news is that many sites are on shared hosting, which means that an IP address alone is not enough. More here: Why doesn't accessing a site by its IP address work?
20-Sep-2009
Posted by: rootkit at September 20, 2009 12:05 AM
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
here my file but I don't see the site that I want to block.
Also this started because whenever I try and goto a particular site it loads it for a second and then redirects me here which I am hoping if I block it will stop this nasty little redirection. Any other assistance would be gratefully accepted. Thanks
Posted by: Greg at September 21, 2009 9:25 PMhttp://ripie6.com/
Posted by: Greg at September 21, 2009 9:26 PMI am adding this post as the web address above didn't show up. trying again
I am trying to block craigslist from my children on my computer, I tried the 127.0.0.1 and added craigslist to the end of the 127.0.0.1 all 3 ways "www.craigslist.org,craigslist.org,craiglist" but using google search I am still able to get to the website.please help-how can I block this website when using google,msn or anyother search engine.
Posted by: michael at December 2, 2009 8:15 PMI having problems with going to youtube everytime i go to the website it is overtaken by another xtremetop100.com is the website that is replacing it and i have no idea why.
Posted by: Tim at December 13, 2009 12:40 PM