Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Possible Duplicate:
dnsResolve and isInNet functions Problem

We have a Proxy.pac file:

function FindProxyForURL(url, host)


if (dnsResolve("ProxyServer") == "")     
  if (dnsDomainLevels(host) == 0 || isInNet(host, "","") || isInNet(host, "","") || isInNet(host, "","") || isInNet(host, "","") || dnsDomainIs(host, "") || dnsDomainIs(host, "") || dnsDomainIs(host, ""))
       return "DIRECT";
        return "PROXY";

     return "DIRECT";

Is working properly, but there are many users that are complaining becauses navigation since proxy.pac deployment is taking to long. It seems dnsResolve and isInNet are the cause of the problem. Is there any other way to improve this script? or how to accelarte dns resolve?

share|improve this question

marked as duplicate by Chris S Sep 24 '12 at 3:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The way I read it, each time you call isInNet(host, ip, mask), it will attempt to resolve the host from the DNS, meaning multiple resolutions, each of which adds time.

Try resolving it once, assigning this resolved host to a variable, then substituting that for 'host' in all of the isInNet calls speeds things up... something like;

var resolvedIP = dnsResolve(host);


isInNet(resolvedIP, "", "") 

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.