Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 have the following line in C:\WINDOWS\system32\drivers\etc\hosts:  myapp.local

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

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
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

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .