FlyerTalk Forums - View Single Post - Question on using the hosts file
View Single Post
Old Feb 27, 2015, 12:12 pm
  #2  
Dodge DeBoulet
 
Join Date: May 2004
Location: Exclusively OMNI/PR, for Reasons
Posts: 4,188
Originally Posted by BigLar
Just resurrected an older laptop and testing it out. I noticed that one particular site was downloading a bunch of ad-related stuff, and I thought, "Of course! I never put in the hosts file."

I couldn't find the one I had been using (~650K) so I googled around and found one from Malwarebytes. I figured these guys ought to know what they're doing, so I downloaded it and installed it. 30 megs. Are you kidding?

Anyhow, I picked an entry at random (let's call it www.dumbsite.com) and put that address in the browser. What I expected to happen was nothing - it would find the entry in the hosts file, try to connect to myself (127.0.0.1) and that would be it. Instead, it went to the site.

So ... I'm probably misunderstanding how this stuff works (nothing new here, folks).

1. Does it matter which browser I use (IE, Chrome, Opera)?

2. Is that how it really works? It first checks the hosts file, then the internal dns cache and then sends out to the ISP's DNS server. If not, what's going on here?
Is the entry in the hosts file to dumbsite.com or www.dumbsite.com? For the type of test you're doing (i.e. via web browser) it's important that you specify the name exactly as it appears in the hosts file. And some browsers will try to "do the right thing" and prepend a www to the name.

Also, if your browser is configured to use a proxy, the hosts file will essentially be ignored.
Dodge DeBoulet is offline