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
wpadresolves 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:
- 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.
- Use setup script: if detection found nothing, the client loads the PAC file from the configured URL. If it loads, it decides.
- Use a proxy server: only when no PAC file could be loaded does the client use the manual proxy, with its exception list.
- 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 on | What happened | Edge, Chrome, Windows programs | Firefox (system settings) | WinHTTP default, curl.exe |
|---|---|---|---|---|
| detect + script + proxy | WPAD answered | A (WPAD) | B (script) | direct |
| detect + script + proxy | no WPAD | B (script) | B (script) | direct |
| detect + script + proxy | no WPAD, script not found (404) | C (manual proxy) | direct | direct |
| script + proxy | script not found (404) | C (manual proxy) | direct | direct |
| script + proxy | script answers DIRECT | direct | direct | direct |
| detect + proxy | WPAD answered | A (WPAD) | C (manual proxy) | direct |
| detect + proxy | no WPAD | C (manual proxy) | C (manual proxy) | direct |
| script + proxy, host in the exception list | script answers B | B (script) | B (script) | direct |
| proxy, host in the exception list | — | direct | direct | direct |
| detect only | no WPAD | direct | direct | direct |
“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 saysDIRECT. 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
wpadanswer 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.exewent direct in every case. They need their own setting:netsh winhttpfor WinHTTP, and-xor thehttps_proxyvariable for curl. - Chrome and Edge can be told to refuse the fallback. The browser policy
ProxySettingshas the fieldProxyPacMandatory. 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
| Product | English label | German label |
|---|---|---|
| Windows 10 and 11 Settings | Automatically detect settings | Einstellungen automatisch erkennen |
| Windows Internet Options | Automatically detect settings | Automatische Suche der Einstellungen |
| Chrome and Edge | follow the Windows switch; policy mode auto_detect | — |
| Firefox | Auto-detect proxy settings for this network | Die Proxy-Einstellungen für dieses Netzwerk automatisch erkennen |
| macOS | Auto 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:
| Switch | What it does |
|---|---|
| Automatically detect settings | WPAD: ask DHCP and DNS for a PAC file |
| Use setup script | use the PAC file at the URL you enter (the explicit PAC URL) |
| Use a proxy server | send 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 advproxyis not on every version. Windows Server 2022 in its original release answered “The following command was not found” (source: lab, 2026-10-13). Usenetsh winhttp show proxythere; 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 valueDisableWpad=1underHKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttpstops 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 policyProxyMode) with the modepac_scriptandProxyPacUrlsets an explicit PAC URL and ignores auto-detection.auto_detectswitches it on,systemfollows the operating system,directuses 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-detectforces auto-detection in one browser profile,--no-proxy-serverswitches 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
Proxywith"Mode": "autoConfig", anAutoConfigURLand"Locked": truesets the explicit PAC URL and stops users from changing it."Mode": "autoDetect"is the auto-detect option.
Turning auto-detection off safely
- Publish the PAC file at a fixed
https://URL, for examplehttps://pac.corp.example/proxy.pac, served as described on the page of PAC and wpad.dat best practices. - Distribute that URL: Windows Use setup script or the browser policies above, macOS Automatic proxy configuration or an MDM profile.
- Then switch auto-detection off everywhere: the Windows switch and
DisableWpad, macOS Auto proxy discovery, and the browser policies. - Keep an authoritative
wpadrecord, or a deliberate NXDOMAIN answer, in every internal DNS suffix for the devices you do not manage, and blockwpad.*lookups to the internet at your resolvers. - Check the result from a client: test the file in the PAC file tester and watch which
wpadnames 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
- Microsoft: Use a proxy server in Windows
- Microsoft: How to disable HTTP proxy features (DisableWpad)
- Microsoft: AutoProxy issues in WinHTTP (performance)
- Microsoft: Security guidelines for system services in Windows Server 2016 (WinHttpAutoProxySvc)
- Microsoft Edge policy: ProxySettings
- Apple: Enter proxy server settings on Mac and Apple Platform Deployment: VPN proxy settings
- Chromium source: pac_file_decider.cc and configured_proxy_resolution_service.cc
- Firefox source: nsPACMan.cpp and Firefox enterprise policy: Proxy
- US-CERT TA16-144A: WPAD name collision vulnerability
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".