Web proxy auto-detection: what "Automatically detect settings" does

The check box "Automatically detect settings" switches on WPAD, the Web Proxy Auto-Discovery Protocol. The computer then asks the network for a PAC file instead of using one you configured. This page shows where the switch is in each system, which setting wins when it is on together with a setup script or a proxy server, what it costs, and how to turn it off safely.

How WPAD works, where it came from and why it is risky is explained on the WPAD page. In short: with auto-detection on, the client first asks DHCP for option 252, which can carry a PAC URL. If that gives nothing, it looks up a host called wpad in DNS and fetches http://wpad.<domain>/wpad.dat. The first answer decides where all web traffic goes.

The alternative is an explicit PAC URL, set by group policy or MDM (mobile device management). For managed devices that is the better choice, for the reasons below.

Auto-detection costs time before the first request

A client with auto-detection on cannot send its first request until it knows whether a PAC file exists. On a network without WPAD, it has to wait until DHCP and DNS give up.

  • Microsoft’s WinHTTP documentation says that auto-detection “can be slow, possibly as long as several seconds”, and that WinHTTP tries DHCP first and DNS second.
  • Chromium (the code behind Chrome and Edge) first checks quickly whether the name wpad resolves at all and gives that check one second. After every change of IP address it waits two seconds and then detects again. When detection fails, it tries again after 8 seconds, 32 seconds, 2 minutes and then every 4 hours.
  • Firefox waits up to five seconds for the DHCP answer on Windows (the preference network.proxy.dhcp_wpad_timeout_sec).

On laptops that change networks often, these waits come back every time. An explicit PAC URL has no such step: the client fetches the file it was told to fetch.

Auto-detection lets the network choose your proxy

Whoever answers first supplies the PAC file, and the PAC file can send all traffic through any proxy. On a hotel or café network, a laptop with auto-detection on accepts the proxy configuration of whoever runs that network. The WPAD page lists the four ways in which that answer can be faked and how to defend against each.

When several switches are on, the first one that works wins

Settings that are switched on together do not combine. The client tries them one after the other and uses the first one that gives an answer:

  1. Automatically detect settings: if DHCP or DNS leads to a PAC file that loads, that file decides. The setup script and the manual proxy are not used at all.
  2. Use setup script: if detection found nothing, the client loads the PAC file from the configured URL. If it loads, it decides.
  3. Use a proxy server: only when no PAC file could be loaded does the client use the manual proxy, with its exception list.
  4. Direct: with nothing else left, the client connects directly.

Chromium’s source code builds exactly this list: WPAD by DHCP, WPAD by DNS, then the configured PAC URL, each tried only after the one before failed (pac_file_decider.cc). When no PAC source works, it uses the manual proxy settings instead (configured_proxy_resolution_service.cc) (source: code, checked 2026-10-13).

What each Windows program did with the switches combined

We switched the three settings on in different combinations on Windows 11 25H2 and sent one request from each program. A wpad name answered with a PAC file pointing to proxy A, the setup script pointed to proxy B, and the manual proxy was C (source: lab, Windows 11 25H2, Edge 155, Firefox 157, 2026-10-13).

Switches onWhat happenedEdge, Chrome, Windows programsFirefox (system settings)WinHTTP default, curl.exe
detect + script + proxyWPAD answeredA (WPAD)B (script)direct
detect + script + proxyno WPADB (script)B (script)direct
detect + script + proxyno WPAD, script not found (404)C (manual proxy)directdirect
script + proxyscript not found (404)C (manual proxy)directdirect
script + proxyscript answers DIRECTdirectdirectdirect
detect + proxyWPAD answeredA (WPAD)C (manual proxy)direct
detect + proxyno WPADC (manual proxy)C (manual proxy)direct
script + proxy, host in the exception listscript answers BB (script)B (script)direct
proxy, host in the exception list—directdirectdirect
detect onlyno WPADdirectdirectdirect

“Windows programs” were Windows PowerShell 5.1 (Invoke-WebRequest, which uses .NET Framework) and a WinINet request, the network library that Office and Explorer use. They gave exactly the same answers as Edge. “WinHTTP default” is a request through the WinHttp.WinHttpRequest object with its default proxy setting, as many scripts use it.

What follows from this:

  • A PAC answer is final, wherever the file came from. This is not special to WPAD: the same holds for a file set through Use setup script or a policy. If the script answers DIRECT, the connection is direct, even with Use a proxy server on. The manual proxy is a fallback for a PAC file that cannot be loaded or run, not for a PAC file that says DIRECT. The page what is a PAC file explains this for every client.
  • The exception list belongs to the manual proxy only. While a PAC file is in charge, the addresses in “Use the proxy server except for…” have no effect; put exceptions into the PAC file.
  • Detection beats your setup script. With Automatically detect settings on next to Use setup script, any wpad answer on the network replaces your script. That is the most common reason why a laptop uses a different proxy on a foreign network. Switch detection off when you set a script.
  • Firefox behaves differently. With its default “Use system proxy settings”, Firefox ignored the detect switch, used the setup script when there was one, and went direct when that script could not be loaded, instead of using the manual proxy.
  • Some programs see none of these settings. The WinHTTP default and curl.exe went direct in every case. They need their own setting: netsh winhttp for WinHTTP, and -x or the https_proxy variable for curl.
  • Chrome and Edge can be told to refuse the fallback. The browser policy ProxySettings has the field ProxyPacMandatory. When it is true, a PAC file that fails blocks the request instead of falling back to the manual proxy or a direct connection (source: code, configured_proxy_resolution_service.cc, checked 2026-10-13).

The same switch has different names

ProductEnglish labelGerman label
Windows 10 and 11 SettingsAutomatically detect settingsEinstellungen automatisch erkennen
Windows Internet OptionsAutomatically detect settingsAutomatische Suche der Einstellungen
Chrome and Edgefollow the Windows switch; policy mode auto_detect—
FirefoxAuto-detect proxy settings for this networkDie Proxy-Einstellungen für dieses Netzwerk automatisch erkennen
macOSAuto proxy discovery—

All of them mean WPAD. The neighbouring settings are the explicit PAC URL (“Use setup script”, “Use automatic configuration script”, “Automatic proxy configuration URL”) and the manual proxy (“Use a proxy server”, “Manual proxy configuration”).

Where the switch is in each system

Windows 11, Windows 10 and Windows Server

The page Settings > Network & internet > Proxy has three independent switches, and all three can be on at the same time:

SwitchWhat it does
Automatically detect settingsWPAD: ask DHCP and DNS for a PAC file
Use setup scriptuse the PAC file at the URL you enter (the explicit PAC URL)
Use a proxy serversend everything to one proxy, except the addresses in the exception list
  • On Windows 11, Automatically detect settings is a switch directly on the page. Use setup script and Use a proxy server each have a Set up button that opens a small dialog with the switch, the address and a Save button.
  • On Windows 10, the page has the same three switches, with the address fields and Save directly on the page instead of in a dialog.
  • Windows Server 2019, 2022 and 2025 with Desktop Experience (the installation with a desktop) have the same Settings page as the Windows version each was built from, and the Internet Options dialog below. Server Core (the installation without a desktop) has neither, so the user settings come from Group Policy or the registry, and the machine setting from netsh winhttp. On Windows Server 2022 Automatically detect settings was on for the administrator, as on Windows 11, and Edge followed the same order as in the table above (source: lab, Windows Server 2022, Edge 155, 2026-10-13).
  • The command netsh winhttp show advproxy is not on every version. Windows Server 2022 in its original release answered “The following command was not found” (source: lab, 2026-10-13). Use netsh winhttp show proxy there; it shows the static WinHTTP proxy only.
  • In Internet Options (inetcpl.cpl), the same settings are on the tab Connections under the button LAN settings. The three check boxes there are Automatically detect settings, Use automatic configuration script and Use a proxy server for your LAN.
  • The settings belong to the signed-in user. On a new Windows 11 profile, Automatically detect settings is on by default (source: lab, Windows 11 25H2, 2026-10-13). Programs that run without a user, such as Windows services, do not follow this switch; they use the WinHTTP setting described next. The page Proxy.pac ignored on Windows 11 explains the two settings in more detail.
  • WinHTTP, the HTTP library used by Windows services and many agents, runs discovery through the WinHTTP Web Proxy Auto-Discovery Service (WinHttpAutoProxySvc). From Windows 10 version 1809 and Windows Server 2019, the DWORD value DisableWpad = 1 under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp stops WPAD for all WinHTTP calls. Microsoft says to switch auto-detection off in Settings as well, because browsers and other programs read that setting.
  • Do not disable the service itself. Microsoft’s service guidance for Windows Server says “Do not disable” WinHttpAutoProxySvc, because anything that uses the network stack can depend on it.
  • In Group Policy, the user policy Windows Components > Internet Explorer > Disable changing Automatic Configuration settings greys out the automatic configuration settings in the Internet Options dialog, so users cannot change them there. It locks the setting; it does not switch it off.

macOS

System Settings > Network, select the network service, Details > Proxies, switch on Auto proxy discovery. The switch Automatic proxy configuration next to it is the explicit PAC URL. Apple’s deployment guide describes the same discovery for proxies set to “Automatic” by MDM without a URL: the device asks for wpad.dat through DHCP (option 252) or DNS (an A record named wpad). With MDM, give the proxy settings an explicit PAC URL instead of relying on discovery.

Chrome and Edge

Chrome and Edge use the operating system’s proxy settings by default, including its auto-detect switch, and then run the discovery with their own network code. On Windows that includes DHCP; on other systems only the DNS lookup for wpad.

  • As a policy, ProxySettings (or the older single policy ProxyMode) with the mode pac_script and ProxyPacUrl sets an explicit PAC URL and ignores auto-detection. auto_detect switches it on, system follows the operating system, direct uses no proxy. In Edge the Group Policy is Administrative Templates > Microsoft Edge > Proxy server > Proxy settings.
  • For a test from the command line, --proxy-auto-detect forces auto-detection in one browser profile, --no-proxy-server switches every proxy off, and --proxy-pac-url=<URL> uses one PAC file. The article on debugging a PAC file in Chrome, Edge and Firefox shows how to see which proxy was chosen.

Firefox

Settings > General > Network Settings > Settings… offers Auto-detect proxy settings for this network, which is Firefox’s own WPAD. It looks up http://wpad/wpad.dat, and on Windows it asks DHCP first (since Firefox 63). Firefox’s default, Use system proxy settings, takes a configured PAC URL from the system but, in the current source, does not follow the system’s auto-detect switch unless the preference network.proxy.system_wpad is true.

  • As a policy, the enterprise policy Proxy with "Mode": "autoConfig", an AutoConfigURL and "Locked": true sets the explicit PAC URL and stops users from changing it. "Mode": "autoDetect" is the auto-detect option.

Turning auto-detection off safely

  1. Publish the PAC file at a fixed https:// URL, for example https://pac.corp.example/proxy.pac, served as described on the page of PAC and wpad.dat best practices.
  2. Distribute that URL: Windows Use setup script or the browser policies above, macOS Automatic proxy configuration or an MDM profile.
  3. Then switch auto-detection off everywhere: the Windows switch and DisableWpad, macOS Auto proxy discovery, and the browser policies.
  4. Keep an authoritative wpad record, or a deliberate NXDOMAIN answer, in every internal DNS suffix for the devices you do not manage, and block wpad.* lookups to the internet at your resolvers.
  5. Check the result from a client: test the file in the PAC file tester and watch which wpad names still appear in your DNS logs.

If a client still does not find or load the file, the article PAC file troubleshooting goes through the symptoms, including the Windows WinHTTP errors 12167 and 12180.

Sources

Frequently asked questions

What does "Automatically detect settings" do?

It makes the computer look for a proxy configuration file (a PAC file) on the network with WPAD, first through DHCP option 252 and then through a DNS lookup for a host called wpad. If it finds one, the browser uses that file to decide which proxy to use for every request.

Should I turn off "Automatically detect settings"?

On managed devices that get their PAC URL from group policy or MDM, yes, because detection adds delay and lets anyone who can answer DHCP or the wpad name on the network supply the proxy configuration. Keep it only where you deliberately use WPAD and own every wpad name in your DNS suffixes.

Why is the first page slow when auto-detect is on?

Before the first request the client has to ask DHCP and DNS for a PAC URL and wait for an answer or a timeout. Microsoft documents that this can take several seconds in WinHTTP, and Chromium runs the detection again after every network change.

How do I disable WPAD by Group Policy?

Configure the proxy explicitly for each client. For Chrome and Edge set the ProxySettings policy (or ProxyMode) to pac_script with your PAC URL; for Firefox set the Proxy policy to autoConfig with an AutoConfigURL and lock it. For Windows itself switch off "Automatically detect settings" and, from Windows 10 version 1809, set the DisableWpad registry value for WinHTTP. Do not disable the WinHTTP Web Proxy Auto-Discovery Service.

What happens if "Automatically detect settings" and "Use a proxy server" are both on?

Edge, Chrome and the Windows programs that follow the user's proxy settings try them in a fixed order. First automatic detection, then the setup script, then the manual proxy server. If detection finds a PAC file, that file decides and the manual proxy server is not used. Only when detection and the setup script both find nothing does the client use the manual proxy server.

If the PAC file returns DIRECT, does Windows fall back to the manual proxy?

No. When a PAC file was loaded, its answer is final. A DIRECT answer means a direct connection, even if "Use a proxy server" is also on. The exception list of the manual proxy does not apply either.

Does Windows Server use "Automatically detect settings"?

The switch exists on Windows Server with Desktop Experience in the same places as on Windows 10 and 11, and it applies only to the signed-in user. Windows services on a server do not follow it. They use the WinHTTP setting, which netsh winhttp shows and sets. Server Core has no Settings app, so the user settings are set by Group Policy or in the registry.

Does Firefox use the Windows "Automatically detect settings" switch?

Not by default. In the current Firefox source, "Use system proxy settings" takes a configured PAC URL from the system but ignores the system's auto-detect switch unless the preference network.proxy.system_wpad is true. Firefox has its own option "Auto-detect proxy settings for this network".

Last updated: