Proxy auto-config dnsResolve doesn't seem to resolve subdomains

Posted by HorusKol on Server Fault See other posts from Server Fault or by HorusKol
Published on 2012-09-24T03:26:39Z Indexed on 2012/09/24 3:39 UTC
Read the original article Hit count: 263

Filed under:
|
|

We're running on a Windows domain, and have a DNS to control computer names on our intranet.

The following PAC works great for basic hostnames on our intranet - but we're setting up some subdomain-like names (example, redesign.buildbox), and it isn't resolving these. These subdomains are resolvable through other means (such as nslookup).

Other than checking to see if the host has ".buildbox" or other domain, is there a way to make it work? Maybe I could try appending the Windows domain to host (can you concatenate strings in a PAC)?

function FindProxyForURL(url, host) {
  // If IP address is internal or hostname resolves to internal IP, send direct.
  var resolved_ip = dnsResolve(host);

  if (isInNet(resolved_ip, "129.2.2.0",  "255.255.255.128"))
    return "DIRECT";

  if (isInNet(resolved_ip, "10.1.1.0", "255.255.255.0"))
    return "DIRECT";

  if (isInNet(resolved_ip, "150.1.2.0", "255.255.255.248"))
    return "DIRECT";

  // All other traffic uses below proxies, in fail-over order.
    return "PROXY 192.111.222.111:8080; DIRECT";
}

© Server Fault or respective owner

Related posts about dns

Related posts about proxy