dns - Split HOSTS file used by Microsoft TCP/IP for Windows

07
2014-07
  • dadsdas asdasd

    I have a file called hosts located at:

    %systemroot%\system32\drivers\etc

    I want to create two partial file of a single one. So that, I can add my entries each time to a new file without having to touch the original one each time. So, is it possible to do so. If yes, How?

  • Answers
  • Mahalusa401

    I am not sure if I understand exactly what you mean but there is 'any file split and join' software. See if it might be of some help to you.. http://www.exnp.com/filesplit/


  • Related Question

    internet explorer - How do I get IE to use my hosts file when using a proxy .pac file?
  • James A. Rosen

    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?


  • Related Answers
  • Heath

    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.

  • djhowell

    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.

  • William Hilsum

    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.