Can anyone help me figure out why Firefox is ignoring my HOSTS file when I use a proxy server? Win XP/Firefox 1.5
I'm a web developer. I'm required to connect to the internet through a proxy at work. I also have to make changes to my hosts file in order to view the different dev/stage/live servers.
Let's say I have the following two entries in my hosts file
192.168.0.100 example.com
192.168.0.101 example.org
If I have my box/browsers setup to connect directly to the Internet, both Firefox and IE will obey the settings in my hosts file. Of course, since I'm not going through a proxy, I can't connect to anything outside the local network.
So, I setup the box/browsers to use
the proxy. Here's where things get weird.
IE will continue to obey the HOSTS file, assuming I add the domain to the "Do not use proxy server for addresses beginning with:" setting.
Firefox, by and large, will also obey settings in the HOSTS file (again, assuming I've added the domain to the "No Proxy For" setting). However, there are
certain domains where it will not. So, in the above example, when I'm set to connect through a proxy, Example.com would resolve to 192.168.0.101, but example.org would ignore the setting in the hosts file, and resolve to something else (192.0.34.166).
Digging through Bugzilla, I came across
this bug, which seems to be related, but I don't know enough about how proxy servers should work vs. how they do work vs. how Mozilla makes them work to fix my issue.
I assume that there's something set on the proxy server that says "hey, it's important that we look this domain up, so ignore local settings", but again my knowledge of what's really going on behind the scenes it too limited to make any use of this theroy.
Has anyone run into this problem with Firefox before? Can anyone recommend tools/procedures for further debugging of proxy server issues in general?
Standard Disclaimers
Yes I've cleared my cache.
Yes I've tried restarting Firefox between proxy changes.
I love reading RFCs. I love practical advice that explains the concepts laid out in RFCs even more.
Yes, the Help Desk/IT Department should be handling this. Their response "oh, we have limited support for Firefox, sorry", (Despite the fact it's a development priority). I'd like to diagnose the problem to the point where I can say to them "I need you to do X, Y and Z".
Yes, the editing of host files is a questionable way to deal with dev/stage/live environments. While suggestions of alternatives are appreciated, I'm months away from having the political power to recommend changes likes that.
Large companies are fun, eh?
If the request goes to the proxy server, the proxy server is going to use whatever is in DNS -- it does not have access to what is in your hosts file, and when a request is sent to a proxy, the request gets looked up by the proxy, NOT your browser. That is, firefox sends a request to the proxy that looks like
GET http://www.example.com/mypage.html
not
GET http://192.168.0.12/mypage.html
What I'd check is whether or not your host entries are correct. Try, for example, pinging both example.com and example.org, and see if they attempt to ping the addresses you're looking for. Or, say, telnet example.com 80 and telnet example.org 80 and make sure it's going to the right place.
posted by RustyBrooks at 12:40 PM on February 10, 2006