pacparser icon indicating copy to clipboard operation
pacparser copied to clipboard

isResolvable() returns true for some ip's but not others

Open programmerPhysicist opened this issue 2 years ago • 1 comments

The function isResolvable appears to sometimes return true for some local ip that should be unresolvable on my local network, but returns false for some ip's that should be resolvable on my local network.

If you have a proxy.pac file:

function FindProxyForURL(url, host) {
  if (isResolvable(host))
  {
    return "DIRECT";
  }
  else
  {
    return "PROXY 192.168.1.150:8080";
  }
}

the above behavior occurs.

programmerPhysicist avatar Mar 29 '22 05:03 programmerPhysicist

This is the logic this function uses: https://github.com/manugarg/pacparser/blob/536b93b4f475cd91aeb3ff31da6ff7a73fef1baf/src/pacparser.c#L117

Given that pacparser is used by so many people and possibly in many environments, and nothing has changed in the DNS resolve function for a long time now, I'd look at your local environment carefully.

For all the hosts for which pactester is not behaving properly, can you share what other resolvers (host, dig, etc) say about those hosts.

manugarg avatar Mar 29 '22 05:03 manugarg

Please feel free to reopen if it's still an issue.

manugarg avatar Feb 22 '23 06:02 manugarg