title: PAC file on Android Devices
body: <p>I have a setup with my Android device on VPN. I also have a pac file so that all internal traffic goes direct and all Internet traffic is routed to the proxy. </p>
  
  <p>For some reason, when I try to go to an Internet page (e.g. bbc.com) it tries to resolve the DNS name in my local DNS Server, rather than send it straight to the proxy server. If I spoof bbc.com in my local DNS to any IP (e.g. 1.1.1.1) then it will forward the request to the proxy server once it is resolved. When it goes to the proxy server, it resolves the correct IP for BBC and I can then reach it.</p>
  
  <p>I have posted the question here because I am not sure if I have coded my pac file wrong, or if this is a bug in Android. Any help would be very much appreciated. My pac file is below;</p>
  
  <pre><code>function FindProxyForURL(url, host)
  {
      //internal sites go direct, as we are connected to VPN
      if (
          shExpMatch(host, "192.168.1.1"))
          {return "DIRECT";}
      //Else - go to the proxy for Internet Access    
      else {return "PROXY ourproxy.domain.domain:8080";}
  }
  </code></pre>