Please register or login. There are 0 registered and 448 anonymous users currently online. Current bandwidth usage: 326.30 kbit/s January 17 - 12:04am EST 
Hardware Analysis
      
Forums Product Prices
  Contents 
 
 

  Latest Topics 
 

More >>
 

    
 
 

  You Are Here: 
 
/ Forums / Windows 7 /
 

  Windows 7 x64 HOSTS File Access Denied 
 
 Author 
 Date Written 
 Tools 
Joshua Marius, LeThe Jul 28, 2010, 11:27am EDT Report Abuse

I am sure some of you may have looked this problem up with some solutions. I had to find the solution to this weird problem myself. Here is what happened and what I did to fix it.

OS' are Windows 7 x64 Professional and Windows 7 x64 Ultimate:
I was able to edit the HOSTS file and I was performing a test. I added the following lines and saved it:

127.0.0.1 http://www.facebook.com
127.0.0.1 http://www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 http://www.myspace.com
127.0.0.1 http://www.myspace.com
127.0.0.1 myspace.com

It would not work and as soon as I tried to modify it, I get Access denied within notepad - even opening up as Administrator. The problem ended up being that AVG (corporate version) detected the HOSTS file as a possible virus and blocked access to it. Here is the same problem on AVG 9 Free:

http://i25.tinypic.com/vxbu8.png

Windows Defender also detected this file as a threat, here are some screenshots:

http://i30.tinypic.com/2ynqn1w.png and
http://i32.tinypic.com/2wdq7t5.png

I messed around with this a bit more, and discovered that the file was not detected as a virus threat as soon as I changed 127.0.0.1 to let's say Google's IP address, as such:

74.125.47.147 http://www.facebook.com
74.125.47.147 http://www.facebook.com
74.125.47.147 facebook.com
74.125.47.147 http://www.myspace.com
74.125.47.147 http://www.myspace.com
74.125.47.147 myspace.com

Hope this helps somebody.


Joshua Marius
http://www.letheonline.net
-----------------------------
Windows 7 Ultimate x64 SP1
Intel Core i5-2500K
ASUS P8Z68-V LX
Intel SSDSC2CW180A3 180 GB
RAID 1: Seagate ST3750528AS 750 GB
CORSAIR Vengeance 8 GB DDR3 1600
eVGA GeForce 8800 GTS
Want to enjoy fewer advertisements and more features? Click here to become a Hardware Analysis registered user.
Jul 28, 2010, 11:49am EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied
A couple of things:

a) Trying to block access to sites via hosts is a silly idea, I have no idea how it started.
If I wanted to get to Facebook, I could still just as easily visit http://69.63.181.12 ... blocking access to the IPs via a perimeter firewall is a lot more effective.

b) Why are you putting 'http://' in your hosts file? hosts is for DNS look-ups, which is entirely independent from HTTP.

Joshua Marius, LeThe Jul 28, 2010, 11:57am EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied

I was able to edit the HOSTS file and I was performing a test. I added the following lines and saved it:

a:
It's not a silly idea. I could be teaching a class; I could be experimenting with Anti-virus behavior; I could be doing an exercise for a class; I could be a Microsoft Beta Tester; I could be an AVG Beta Tester

b:
Just tried the following.
Edited hosts to:
74.125.45.103 letheonline.net

Opened Internet Explorer, typed in letheonline.net and this goes to 74.125.45.103 which is Google.

Typed in http://www.letheonline.net, went to http://www.letheonline.net. I would check your facts.

Joshua Marius
http://www.letheonline.net
-----------------------------
Windows 7 Ultimate x64 SP1
Intel Core i5-2500K
ASUS P8Z68-V LX
Intel SSDSC2CW180A3 180 GB
RAID 1: Seagate ST3750528AS 750 GB
CORSAIR Vengeance 8 GB DDR3 1600
eVGA GeForce 8800 GTS
Jul 28, 2010, 12:13pm EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied
Joshua Marius, LeThe (34532) said on Jul 28, 2010 at 08:57am PDT:
Opened Internet Explorer, typed in letheonline.net and this goes to 74.125.45.103 which is Google.

Typed in http://www.letheonline.net, went to http://www.letheonline.net. I would check your facts.

That's because you only added letheonline.net to your hosts file, and then you tried to go to www.letheonline.net. Those are different domains.

And I never said that "performing a test" was a silly idea. I said:

McFly (52972) said on Jul 28, 2010 at 08:49am PDT:
Trying to block access to sites via hosts is a silly idea[.]

(with added emphasis)

Joshua Marius, LeThe Jul 28, 2010, 12:23pm EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied
No McFly, I added letheonline.net to the HOSTS file and went to letheonline.net and it worked as expected, but if I try it with http:// or www. it does not work, it ignores that entry and proceeds to the website. So that's why I also added with www. and http., these were simple tests to monitor how the file gets used, and what processes use it, etc.,

What is pretty irritating is that in this forum there is always some member that somehow gets annoyed when somebody else posts simple info on a problem they face. Immediately they have to give out their opinion about it, or say what they think. "Trying to block access to sites via hosts is a silly idea" - It may seem that way to you and I completely understand, trust me I see people post very silly things, but I am sure as silly as it is, it's helped thousands to get the job done.

Not trying to start a flame war here, but a simple "Thanks for sharing this info" would have been more welcoming. I struggled with this problem for hours as nobody had any info on it, anywhere, and I posted it here so there would be some info to help others. That's all I'm trying to do.


Joshua Marius
http://www.letheonline.net
-----------------------------
Windows 7 Ultimate x64 SP1
Intel Core i5-2500K
ASUS P8Z68-V LX
Intel SSDSC2CW180A3 180 GB
RAID 1: Seagate ST3750528AS 750 GB
CORSAIR Vengeance 8 GB DDR3 1600
eVGA GeForce 8800 GTS
Jul 28, 2010, 12:39pm EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied
If you add this to your hosts file:
74.125.45.103 letheonline.net

This is what should happen in your browser:
letheonline.net --> Google
http://letheonline.net --> Google
https://letheonline.net --> Either Google SSL or a security warning telling you that the cert is valid only for google.com
http://www.letheonline.net --> http://www.letheonline.net
http://www.letheonline.net --> http://www.letheonline.net

If that's not what you see, either your browser is retarded or you didn't clear your DNS cache.

A simple "Thanks for correcting me, McFly" would have been more welcoming.

Joshua Marius, LeThe Jul 28, 2010, 12:50pm EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied

Sorry but that's just not what's happening. And I'm not trying to post bogus information, that's probably your excuse to get angry and start cursing and fighting, as you just did. I'm posting exactly whats happening on several machines (just tried again), not stuff I'm making up to try and fool others (since that's the real meaning of bogus right?).

I even flushed out the DNS Cache, tried this out in two computers in two different locations, three different browsers, same thing...exactly as I describe it.

I seriously hope the ADMINS are watching this thread - because this is the exact same reaction I get almost everytime I try to help on these forums and hence the reason why I'm barely on here anymore. This is what happened last time, yet I still get emails of people joining this forum just to say thanks for "posting that" or "sharing that info" and how it's helped them out. I just don't get the aggression and so much anger...I'm just trying to help...nothing else.

Joshua Marius
http://www.letheonline.net
-----------------------------
Windows 7 Ultimate x64 SP1
Intel Core i5-2500K
ASUS P8Z68-V LX
Intel SSDSC2CW180A3 180 GB
RAID 1: Seagate ST3750528AS 750 GB
CORSAIR Vengeance 8 GB DDR3 1600
eVGA GeForce 8800 GTS
Jul 28, 2010, 01:01pm EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied
I apologize for my language.

However, if you add to your hosts file (note the no www):
74.125.45.103 letheonline.net

And then in your browser, you go to (no www):
http://letheonline.net

You should be ending up at Google. There should be a request to your DNS server, "what's the IP for letheonline.net?" ... but it first consults your hosts file. So it sees that it already knows the IP (74.125.45.103), and thus doesn't have to ask your DNS server. So you should end up at Google. Okay, so you're not. Something else is going on then.

With that (above) in your hosts file, where DO you end up when going to:
http://letheonline.net (no www)

http:// letheonline.net
or
http:// www.letheonline.net


Joshua Marius, LeThe (34532) said on Jul 28, 2010 at 09:23am PDT:
Immediately they have to give out their opinion about it, or say what they think. "Trying to block access to sites via hosts is a silly idea" - It may seem that way to you and I completely understand, trust me I see people post very silly things, but I am sure as silly as it is, it's helped thousands to get the job done.

Opinions are a good thing. I will say this again, trying to block access to sites that way is silly. It's simply not how it's supposed to be done. That's not the purpose of the hosts file. This contrasts with trying to block http:// individually in your hosts file, which is just plain wrong.


127.0.0.1 block-this-site-plz.com # will work, but improper and easily bypassed
127.0.0.1 http://block-meee.com # won't work, because hostnames don't contain http:// !!


In my first reply, I didn't just say "it's silly." I gave you an example of just how easy it is to bypass, as well as a more effective alternative. I just really hope you're not employing that method of blocking a site in an IT capacity, because it's amatuer-hour at best.

kOrny Jul 28, 2010, 01:37pm EDT Report Abuse
>> Re: Windows 7 x64 HOSTS File Access Denied
RRREEEEERRRRR

Tools->Internet Options->Content tab->Enable->General tab->Create password

BAM

No one can go to any website unless they have the password ;)



 

    
 
 

  Topic Tools 
 
RSS UpdatesRSS Updates
 

  Related Articles 
 
 

  Newsletter 
 
A weekly newsletter featuring an editorial and a roundup of the latest articles, news and other interesting topics.

Please enter your email address below and click Subscribe.