Troubleshoot proxy.pac: why a PAC file is not working and how to fix it
PAC file problems rarely show an error. When a PAC file is not loading or not working, traffic just goes direct, to the wrong proxy, or slowly. Start from what you see, find the cause, and confirm the fix with a step-by-step trace of the failing URL.
How do you troubleshoot a proxy.pac file that is not working? You start from what you see, find the
cause, and then confirm it. A PAC file (proxy auto-configuration file, often proxy.pac or wpad.dat) is
a small JavaScript program that the browser runs for every request to choose a proxy; the page
What is a PAC file? explains it from the start. When something goes
wrong, the browser rarely tells you. When the script throws an exception or returns nothing, Chromium
and Firefox fall back to a direct connection (source: code, verified 2026-10-04). Chromium also goes
direct when it cannot fetch the file, unless a policy marks the PAC as mandatory (source: code, verified
2026-10-04). So the first sign of trouble is often a complaint that “the proxy is not used”, or proxy
logs that stay empty.
In real files, the most common causes are a syntax error (about a third of the files), DNS lookups that make requests wait, look-alike domain patterns and scripts that fail for some addresses; the top 20 PAC file mistakes list them. For problems inside the script, the quickest way to confirm the cause is the live PAC trace in the online PAC file tester. It runs your file in your browser for one URL and one client IP, and it shows step by step how the script reached its answer.
Which page answers my symptom?
Each symptom has a short answer below. Where one client or one topic needs more detail, a separate page covers it.
| What you see | Usual cause | Details |
|---|---|---|
| Traffic goes direct, no error | The file is not loaded, or the script fails | Why is the PAC file not loaded? and Why does the script not run? |
| Chrome or Edge ignores the file | A policy or an extension wins, or the file fails | PAC file not working in Chrome or Edge |
| Windows programs or services ignore the file, or show error 12166, 12167 or 12180 | They read another setting, or the Windows engine fails | Proxy.pac ignored on Windows 11 |
| A Group Policy or Intune setting has no effect | The setting landed where the program does not look | PAC file not applied by Group Policy or Intune |
| wpad.dat is not found | Auto-detection finds no PAC URL | WPAD not loading |
| One URL goes to the wrong proxy, or direct | A rule matches more or less than you think | Why does a URL go to the wrong proxy? |
| It works in Chrome but not in Windows programs | Windows runs the file in its own engine | Windows runs PAC files differently |
| Every page starts slowly | DNS lookups in the PAC file | DNS in PAC files |
| A fix has no effect | The client still uses its old copy | Reset the PAC cache |
How do I trace one URL through the PAC file?
- Paste the file into the tester, or open it with Load file….
- Enter the failing domain or URL above the editor. A domain alone is tested as
https://. - If a rule uses
myIpAddress(), enter the client IP of the affected user. Otherwise the tester uses 192.168.1.100. - Choose the engine profile of the affected browser, for example the current Chromium version.
- Press Check. The editor area switches to the Path tab.
The Path tab shows your file with the path of the URL marked on it:
- a number in front of each line that ran, in the order the lines ran;
- ✔ or ✘ on every
iftest, for true or false; - under the line, every built-in call it made, with its arguments and its result;
- ▶ on the
returnthat decided, with the result; - dimmed lines for branches that were skipped.
If you have inherited the file and first want to know what it does at all, open the Annotated tab. It shows the file with an explanation comment above each rule, read from the code without running it, and you can download the annotated copy.
The trace runs in a sandbox in your browser. The file and the URL are not sent anywhere. Check also rates the whole file against the rule catalogue, so you get the list of known mistakes at the same time.
Example: why does a look-alike domain slip past the proxy?
A company wants its own domain corp.example to go direct and everything else through the proxy:
function FindProxyForURL(url, host) {
host = host.toLowerCase();
if (isPlainHostName(host) || shExpMatch(host, "*corp.example")) {
return "DIRECT";
}
return "PROXY proxy.corp.example:8080";
}
A user reports that evilcorp.example is not filtered. The trace of evilcorp.example shows why:
https://evilcorp.example/ → DIRECT (line 4) · Chrome ≥ 52
1 3 ✔ if (isPlainHostName(host) || shExpMatch(host, "*corp.example")) {
↳ isPlainHostName("evilcorp.example") → false
↳ shExpMatch("evilcorp.example", "*corp.example") → true
2 4 ▶ return "DIRECT";
⇒ DIRECT
The pattern *corp.example has no dot after the *, so it also matches every domain that merely
ends in “corp.example”. The fix is dnsDomainIs(host, ".corp.example") || host === "corp.example"
(PAC-X004). After the edit, Check again: the
same URL now reaches line 6 and returns the proxy. The tab label says “(outdated)” until you check
again, so you cannot mistake an old trace for the current file.
Why is the PAC file not loaded?
What you see. Traffic goes direct, or there is no proxy at all. Chrome and Edge connect directly
without a message. Only when a policy marks the PAC as mandatory do they stop with
ERR_MANDATORY_PROXY_CONFIGURATION_FAILED (net error -131). Chromium’s source describes this error
as “a mandatory PAC script could not be fetched, parsed or executed” (source: code,
net_error_list.h,
checked 2026-10-11). Windows programs that use WinHTTP report an error number instead; the page
Proxy.pac ignored on Windows 11 explains 12167 (download
failed) and 12180 (auto-detection found nothing).
The usual causes, and how to check each one:
- The URL does not return status 200. Open the PAC URL from the affected machine, with the same proxy settings, and look at the status code and any redirect (PAC-D010).
- Auto-detection finds nothing, so wpad.dat is not found. With “Automatically detect settings”, the
client looks for the PAC URL in DHCP option 252 and by a DNS lookup of the name
wpad. The page WPAD not loading goes through these lookups in the order the client makes them. - The file is served from a file path or an SMB share. Chromium no longer accepts
file://PAC URLs, so the setting silently does nothing there, while Windows components may still use it (PAC-D009). - The server answers in a way the client refuses. A login prompt, a file larger than about 1 MiB, an answer slower than about 30 seconds, a UTF-16 file or a compressed answer the client did not ask for all fail on Windows. The page WPAD not loading has the table, and it applies to an explicit PAC URL as well.
- The setting never reached the program. A policy may have put the PAC URL into a setting the program does not read; see PAC file not applied by Group Policy or Intune.
To check the delivery of the file, paste the response headers into the tester under “Delivery”:
curl -sI https://pac.corp.example/proxy.pac.
Why does the file load but the script not run?
What you see. As above, traffic goes direct. Chromium records ERR_PAC_SCRIPT_FAILED (-327)
in the NetLog. Windows programs that use WinHTTP report error 12166, which the page
Proxy.pac ignored on Windows 11
explains.
The usual causes are these:
- A syntax error, often from a missing brace or a quote after a hand edit (PAC-E001). The tester shows “The PAC could not be loaded” with the line.
- The file uses modern JavaScript in an older engine.
?.,??and object spread work in current browsers but stop the whole file from loading on Windows (PAC-K020);let,const, arrow functions and methods such asincludesfail in older engines such as pactester 1.4 (PAC-K001, PAC-K010). The tester flags both. - The script throws an exception at run time, for example a call to a function that does not exist in this
engine. The Microsoft
isInNetExfamily does not exist in Firefox (PAC-K003, PAC-E006). The trace stops at the line that threw, and the result line shows the error. - The script returns no value for some URLs. Chromium and Firefox then go direct (PAC-X001).
- The file contains invisible characters pasted from a web page or a chat, such as a byte order mark or a zero-width space (PAC-E013, PAC-E015).
Why does a URL go to the wrong proxy, or direct?
This is the most common case, and the one the live trace is made for. Trace the failing URL and look for the first ✔ or ✘ that you did not expect. The call under that line shows the exact value the script compared. Typical findings:
- The rule tests
urlinstead ofhost. A host pattern applied to the URL also matches text that anyone can put into a link: the query of an http address in Chrome and Windows, for examplehttp://evil.example/?corp.example, or a fake user name in Firefox, for examplehttps://corp.example:x@evil.example/(PAC-C001). - The browser hides the path. For
https://URLs, Chrome passes onlyhttps://host:port/to the script, and Firefox does this for every scheme by default (source: lab, Chromium 145 and Firefox 157, 2026-10-12). A rule on a path never matches there. The trace shows the URL the engine passed under the code. - The host or the pattern has upper-case letters, but
shExpMatchand==compare case-sensitively. Lower-casehostfirst (PAC-K009). - A pattern matches too much or too little, because of a leading
*without a dot, adnsDomainIspattern without a leading dot, or regular-expression syntax inshExpMatch(PAC-X003, PAC-K015, PAC-C009). - A manual proxy is set as well, and you expect it to apply. A PAC answer of
DIRECTmeans direct, and the exception list of “Use a proxy server” is ignored while a PAC file is in charge. The manual proxy is used only when the PAC file cannot be loaded; see a PAC file overrides the manual proxy setting. - An earlier rule wins. The step numbers show which
returncame first (PAC-C014). isInNetis called with swapped arguments or a wrong mask (PAC-C016, PAC-C007).- The file worked in pactester, but pactester and the browsers answer some calls differently, for
example
isInNetwith"10.0.0.0/8"or a range such asweekdayRange("FRI", "MON"); see pactester vs Chrome and Firefox.
The result can also depend on the user’s network. Rules with myIpAddress() give different answers at
home, in the office and on VPN, and on machines with several network adapters the function may
return another address than you expect (PAC-K013). Enter the
affected user’s address as the client IP and check again. The trace shows what myIpAddress()
returned and which branch that chose.
Sometimes the proxy itself fails. If the trace returns the right proxy but the page still fails, the
problem is after the PAC. Chrome shows ERR_PROXY_CONNECTION_FAILED (-130) when it cannot connect
to the proxy the script returned. Firefox shows “The proxy server is refusing connections” or
“Unable to find the proxy server” (expert).
Why is every page slow?
What you see. Pages start late, especially on VPN or on a bad network, while the proxy itself is
fast. The usual cause is a DNS lookup in the PAC file: isInNet(host, …), dnsResolve or
isResolvable (PAC-P001,
PAC-P002). Only the first request to a host name waits for the
lookup, because the engines keep the answer. When the DNS server does not answer, as can happen on
VPN, every request waits, on Windows about 12 seconds per call (source: lab, Windows 11, 2026-10-14, measured again 2026-10-16).
The trace lists every dnsResolve and isInNet call for the URL, so you can see how many lookups
one request needs. The article DNS in PAC files has the measurements
and shows how to write the same rules without DNS.
Why does a change not take effect?
Browsers and Windows keep the downloaded PAC file and the result of auto-detection for a while, and
ipconfig /flushdns does not clear them. The page on resetting the PAC cache
shows what each engine keeps and how to make it load the file again. While testing, use a fresh
browser profile and restart it after each change. The article
Debugging a PAC file in Chrome, Edge and Firefox shows
how to load a PAC file into a test profile and how to read what the browser really did.
What should I check before I open a ticket?
Most “the browser ignores my PAC” reports turn out to be one of the top 20 PAC mistakes. Trace the failing URL in the tester, read the findings, and then compare with the real browser. If the trace and the browser disagree, the browser log shows why. The page best practices lists the habits that prevent most of these problems.
Frequently asked questions
How do I troubleshoot a proxy.pac file?
Start from what you see and check four things in this order. First, check that the client really uses the file, at chrome://net-internals/#proxy in Chrome or Edge or in the Windows proxy settings. Second, open the PAC URL from the affected machine and check that it answers with status 200. Third, paste the file into the tester at findproxyforurl.net/check/, enter the failing URL and press Check; it shows syntax errors and known mistakes, and the trace shows which line decided. Fourth, after a fix, make the client load the file again, because browsers and Windows keep the old copy.
Why is my PAC file not working?
There are three usual reasons. The client cannot download the file, the script fails when it runs, or the script runs but returns a different proxy than you expect. A failed download or a script error usually makes the browser go direct without any message. Paste the file into the tester at findproxyforurl.net/check/ and enter the failing URL. The live trace shows whether the file loads, which tests were true or false, and which line decided.
Why is my PAC file not loading?
The client does not know the PAC URL, cannot download the file, or still uses an old copy. Open the PAC URL from the affected machine, for example with curl, and check for status 200 without a redirect to a login page, a size under 1 MiB, and an answer well within 30 seconds, which is where Chrome and Windows give up. A file:// path or an SMB share does not work in Chrome and Edge. With auto-detection, go through the checks on the page WPAD not loading at findproxyforurl.net/articles/wpad-not-working/. After a fix, make the client load the file again, because ipconfig /flushdns alone does not do that.
Why is my proxy.pac ignored?
Usually because another setting wins. A Chrome policy or a proxy extension replaces the system settings, Windows services use the separate WinHTTP setting, and a VPN connection has its own proxy settings. If the file is used but fails, the browser goes direct without a message, which also looks like the file is ignored.