Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried editing "C:\Windows\System32\Drivers\etc\hosts" by adding:

127.0.0.1 websitetoblock.com

But I can still access the website. Ideally I want to be redirected to a URL of my choice if I try to access the other one. How can I do this?

share|improve this question
    
Are you trying to do this at a system level (so for everyone who uses the computer) or at a browser level (for someone who uses chrome, for example) – Frank Apr 25 '13 at 17:11
up vote 2 down vote accepted

Flush the DNS resolver cache. No need to reboot to do this; at the command prompt, type:

ipconfig /flushdns

The hosts file cannot be used for HTTP URL redirection.

share|improve this answer
    
Yeah, I could not remember the flushing command. If he did reboot, that would of course work as well. – Deleted Apr 25 '13 at 17:13

It looks fine. Try restarting the computer. The name is probably already resolved and cached.

share|improve this answer

edit the hosts file as follows.

74.125.236.165 http://www.facebook.com

if you edited your host file like this, when you go to fb u will be redirected to google.com

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.