Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following line in C:\WINDOWS\system32\drivers\etc\hosts:

192.168.12.1  myapp.local

When I open up a command prompt and type "ping myapp.local", I get a response from 192.168.12.1.

When I open up IE7, however, and type "http://myapp.local" into the address bar, I get a DNS error. I have my LAN connection set up to use a proxy.pac file, which IE seems to be trying to use for this address.

How do I get IE to check my hosts file first?

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

What does your network's proxy.pac look like? Do you have access to modify it?

I have a proxy autoconfig in my network. I set a hosts file entry on my XP box like yours, and I was still able to connect to myapp.local in IE8 (sorry, don't have IE7 handy to test).

I'm guessing your proxy autoconfig does something that tries to resolve the hostname (mine does not); and that resolving doesn't use the hosts file thus it fails.

If you can modify the proxy.pac, add the following to the beginning of FindProxyForURL (before any other code)

if(dnsDomainIs(host, ".local")) { return "DIRECT"; }

Change 'host' in that line to match the second argument of FindProxyForURL. Hopefully this will prevent the autoconfig script from trying to resolve your .local hostname.

share|improve this answer
    
I can't modify the hosted version, but I can download it, edit it, and use the local one! –  James A. Rosen Oct 1 '09 at 14:25
    
So there's no way to do it with out changing the proxy? I only want the change for a specific set of PC's under the proxy, not every PC. –  JackDev Sep 10 '13 at 0:49
add comment

Under Tools -> Internet Options -> Connections Tab -> LAN Settings is the "Use proxy server for your LAN ..." box checked? If so, check the other box that says "Bypass proxy server for local addresses" and then click the Advanced button and add myapp.local to the Exceptions list at the bottom.

share|improve this answer
1  
As the dialog box suggests, the automatic proxy (PAC) settings override these, so I have to turn off "use automatic configuration script." The real answer is: "it's not possible when using automatic proxy configuration." –  James A. Rosen Aug 27 '09 at 12:30
add comment

I am unsure about proxy.pac as I have not heard about this, so maybe ignore my answer.

It should be checking your hosts file before anything else, it is possible that a old entry is cached. Close Internet Explorer, Go to a (elevated on Vista/7) command prompt and type

ipconfig /flushdns

and restart IE.

Test it now, if it still does not work because of a proxy file, (again, I have little experience here), try adding it to the exceptions in the proxy list.

As your are pinging the correct IP, I think it is just a cache issue as I have sometimes had the same thing after just adding a entry. A restart for me usually does the trick.

share|improve this answer
    
Neither the DNS flush nor the IE restart worked. I had to resort to taking off the automatic PAC configuration and configuring the proxy manually with exceptions as you suggest in paragraph three. –  James A. Rosen Aug 26 '09 at 20:12
add comment

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.