WPAD: the Web Proxy Auto-Discovery Protocol and wpad.dat
WPAD, the Web Proxy Auto-Discovery Protocol, lets a computer find its PAC file without any configuration. It is convenient, and it is also one of the oldest ways to take over a whole network's web traffic.
A PAC file (proxy auto-configuration file) is a small JavaScript program that tells the browser, for every request, whether to use a proxy (what a PAC file is). Before a browser can use one, it needs the file’s URL. Either an administrator sets that URL, or the browser looks for it on the network. WPAD is the second way.
WPAD started as a 1999 draft and never became a standard
WPAD was written up in the IETF, the body that publishes internet standards, as the Internet-Draft
Web Proxy Auto-Discovery Protocol (draft-ietf-wrec-wpad). An Internet-Draft is a proposal that
expires unless it moves on. Version 00 is dated June 1999 and version 01 July 1999; the authors came
from Inktomi, Microsoft, RealNetworks and Sun. The draft expired and was never published as an RFC,
the form that internet standards take. Microsoft’s WinHTTP documentation says the same: the
specification “never progressed beyond the Internet-Draft stage”.
Even so, the vendors had already built it into their products, and it is still there today: in Windows, macOS, Chrome, Edge and Firefox. Because no standard was ever finished, each client implements a slightly different part of the draft.
Discovery tries DHCP first, then DNS
When “automatically detect settings” is on (the page on automatic proxy detection shows where that switch is in each system), the client looks for a PAC URL in this order:
- DHCP option 252. DHCP is the protocol that hands out IP addresses when a device joins a network. The draft reserves option number 252 for a PAC URL; if the DHCP server sends that option, the client uses the URL in it.
- DNS. If DHCP gives no URL, the client looks up a host called
wpadin its own DNS domain and fetcheshttp://wpad.<domain>/wpad.dat. The path/wpad.datand plain HTTP on port 80 are the draft’s defaults.
The draft also lists SLP (Service Location Protocol) and DNS SRV and TXT records. None of the clients below uses them.
Whatever answers first supplies the PAC file, and the PAC file decides where all web traffic goes.
The DNS walk
The draft tells the client to start with its full domain and remove one label at a time. A client
in pc.eng.corp.example would try wpad.eng.corp.example, then wpad.corp.example, then
wpad.example, and stop before a top-level domain such as com. This step-by-step shortening is
called the DNS walk, and it is the dangerous part: the last names it asks for are often not owned by
your organisation.
The clients differ here:
- Chrome, Edge and Firefox look up only the single name
wpadand leave the rest to the operating system’s DNS suffix search list. Firefox’s source code says on purpose that it does not walk the domain, because the list of top-level domains keeps changing. The walk has not gone away, though: it has moved into the operating system’s resolver, and on Windows the browsers’ lookup ofwpadis subject to DNS devolution like any other single-label name. - Windows resolves the single name
wpadthrough its DNS client. With DNS devolution (Microsoft’s term for appending the parent domains of the computer’s DNS suffix) it may also try parent domains. In an Active Directory domain, devolution stops at the forest root domain by default since Windows 7; before that it went on until two labels were left. The Group Policy settings “Primary DNS Suffix Devolution” and “Primary DNS Suffix Devolution Level” under Computer Configuration > Administrative Templates > Network > DNS Client control it.
Which client uses which method
| Client | DHCP option 252 | DNS lookup | Source |
|---|---|---|---|
| Windows programs that use WinHTTP or WinINet, including Windows services | yes, tried first | yes | doc, Microsoft: AutoProxy issues in WinHTTP |
| macOS (“Auto proxy discovery”, or automatic proxy without a URL) | yes | yes, A record wpad | doc, Apple Platform Deployment |
| Chrome and Edge | Windows and ChromeOS only | yes, http://wpad/wpad.dat | code, Chromium 155, url_request_context_builder_mojo.cc and pac_file_decider.cc, checked 2026-10-14 |
| Firefox (“Auto-detect proxy settings for this network”) | Windows only, since Firefox 63, with the preference network.proxy.enable_wpad_over_dhcp (default true) | yes, http://wpad/wpad.dat | code, nsPACMan.cpp and bug 356831 |
Chrome and Edge take the on/off switch from the operating system’s proxy settings, but then run the discovery with their own network code, as shown in the table. Firefox has its own switch. The details for each system, the switches and the policies are on the page about automatic proxy detection.
wpad.dat and proxy.pac are the same file, delivered in different ways
A wpad.dat and a proxy.pac contain the same thing: a PAC file with a
FindProxyForURL(url, host) function. You can serve the same file under both
names, and you test both in the same way. What differs is how the client finds the file:
| Explicit PAC URL (proxy.pac) | WPAD discovery (wpad.dat) | |
|---|---|---|
| How the client finds it | URL set by group policy, MDM or by hand | DHCP option 252, or a DNS lookup for a host called wpad |
| Transport | whatever the URL says; use HTTPS | plain HTTP when found through DNS (PAC-D001) |
| Who can supply the file | the server you configured | the first DHCP answer on the segment (PAC-D008), or whoever answers the wpad name (PAC-D007) |
| Works on unmanaged devices | only if configured | yes, that is its point |
Which to use:
- Managed devices: an explicit
https://PAC URL, distributed by policy. Switch off “automatically detect settings” where you do not need it. - Where WPAD cannot be avoided, such as guest networks and unmanaged devices: own a
wpadrecord in every internal DNS suffix, blockwpad.*lookups to the internet at your resolvers, and switch on DHCP snooping on the access switches if you use option 252.
To create either file, use the wpad.dat generator or the PAC file generator, or copy one of the PAC file examples.
Is WPAD secure? Four built-in risks
- A wpad lookup can leave your namespace. The browsers ask only for
wpad, but the operating system adds its DNS suffixes, and on Windows without a suffix search list also parent domains. A suffix you do not own, or a laptop that asks a public DNS server, sends the question forwpadoutside your organisation. Publicwpadnames have been registered and abused; the 2016 US-CERT alert TA16-144A documents the name-collision attacks. See PAC-D007 and the page on the wpad DNS record. - Discovery uses plain HTTP. Anyone who can tamper with the network path can rewrite the file and route all traffic through a proxy of their choice. See PAC-D001.
- DHCP is unauthenticated. Any device that answers DHCP on the segment can hand out its own PAC URL (PAC-D008).
- Windows also asks the local network. When DNS has no
wpadname, Windows 11 also asks the local segment through mDNS, NetBIOS and LLMNR, and any device there can answer. The page the wpad DNS record shows how to keep the question inside your DNS.
These risks belong to the discovery, not to the file. Whether a PAC file itself is secure, and whether you should still use one, is answered on the page should you still use a PAC file.
Doing it safely
- Distribute the PAC URL explicitly (group policy, MDM, configuration management) and serve it over HTTPS. Then switch off automatic detection where you do not need it, as described on the page about automatic proxy detection.
- If you must keep WPAD, create an authoritative
wpadrecord in every internal DNS suffix and blockwpad.*lookups to the internet at your resolvers. - Serve the file with
Content-Type: application/x-ns-proxy-autoconfigand an explicitCache-Control: max-age=…of at most a day (PAC-D002, PAC-D003). - Make sure the file ends with an unconditional
return, so that clients never fall back to a direct connection by accident (PAC-X001).
The file itself follows the same rules as any PAC file; they are collected on the page of PAC and wpad.dat best practices.
Testing a wpad.dat
A wpad.dat is an ordinary PAC file, so the online PAC file tester works as a WPAD tester too:
- Fetch the file the way a client would:
curl -sS -D - http://wpad.corp.example/wpad.dat. - Paste the body into the tester and enter a URL you care about. The live trace in the Path tab shows step by step how the wpad.dat routes it.
- Under Delivery, choose “WPAD DNS discovery” (or “DHCP option 252”) and paste the response headers. The tester then grades the delivery along with the file itself.
Also check from a client in each DNS suffix which wpad names resolve. The answer should come from
your own DNS server, or be NXDOMAIN, and never from a public name.
When WPAD is not loading
The page WPAD not loading goes through seven checks in the order a client makes them. Three pages go deeper into one part each: DHCP option 252 (who reads it and how to set it), the wpad DNS record (A or CNAME, the Windows block list and the DNS suffixes) and resetting the PAC cache (what each client keeps after a fix). Problems inside the file itself are sorted by symptom on the page PAC file troubleshooting.
References
- WPAD Internet-Draft, version 00 (June 1999) and version 01 (July 1999)
- Microsoft: WinHTTP AutoProxy support and AutoProxy issues in WinHTTP
- Microsoft: DNS devolution
- Apple: VPN proxy settings for Apple devices (WPAD over DHCP and DNS)
- Chromium source: pac_file_decider.cc and Firefox source: nsPACMan.cpp
- US-CERT TA16-144A: WPAD name collision vulnerability
- MDN: Proxy Auto-Configuration (PAC) file
Frequently asked questions
What is the Web Proxy Auto-Discovery Protocol (WPAD)?
WPAD is a way for browsers and other clients to find the URL of a PAC file on their own, first through DHCP option 252 and then through a DNS lookup for a host called wpad. It was written as an IETF Internet-Draft in 1999 and never became an RFC, but Windows, macOS, Chrome, Edge and Firefox all implement it.
What is the difference between proxy.pac and wpad.dat?
None in content. Both are PAC files with a FindProxyForURL function, and you can serve the same file under both names. wpad.dat is the file name that WPAD discovery asks for, over plain HTTP from a host called wpad; proxy.pac is the usual name when the URL is configured explicitly, which can and should be an https URL.
Which MIME type should a PAC file be served with?
application/x-ns-proxy-autoconfig. Most browsers do not insist on it, but an application/octet-stream or text/html response usually means the server is not set up for the file or is returning an error page.
Should I use WPAD at all?
Prefer distributing the PAC URL explicitly through group policy or MDM, served over HTTPS. Use WPAD only where you cannot configure clients, own every wpad name in your DNS suffixes and stop wpad lookups from leaving your network.
How do I test a wpad.dat file?
A wpad.dat is a PAC file, so test it like one. Paste it into the online PAC file tester at findproxyforurl.net/check/, enter the URL to test and paste the output of curl -sI http://wpad.<your domain>/wpad.dat to grade how it is served. The tester also flags WPAD discovery as a delivery risk.