# WPAD: the Web Proxy Auto-Discovery Protocol and wpad.dat

Source: https://findproxyforurl.net/wpad/ · last updated 2026-10-15

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](https://findproxyforurl.net/articles/what-is-a-pac-file/)).
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](https://findproxyforurl.net/wpad/auto-detect/) shows where that switch is in each system), the client
looks for a PAC URL in this order:

1. **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.
2. **DNS.** If DHCP gives no URL, the client looks up a host called `wpad` in its own DNS domain and
   fetches `http://wpad.<domain>/wpad.dat`. The path `/wpad.dat` and 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 `wpad` and 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 of
  `wpad` is subject to DNS devolution like any other single-label name.
- **Windows** resolves the single name `wpad` through 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](https://learn.microsoft.com/en-us/windows/win32/winhttp/autoproxy-issues-in-winhttp) |
| macOS ("Auto proxy discovery", or automatic proxy without a URL) | yes | yes, A record `wpad` | doc, [Apple Platform Deployment](https://support.apple.com/guide/deployment/depb78836926/web) |
| Chrome and Edge | Windows and ChromeOS only | yes, `http://wpad/wpad.dat` | code, Chromium 155, [url_request_context_builder_mojo.cc](https://chromium.googlesource.com/chromium/src/+/refs/tags/155.0.8059.83/services/network/url_request_context_builder_mojo.cc) and [pac_file_decider.cc](https://chromium.googlesource.com/chromium/src/+/main/net/proxy_resolution/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](https://searchfox.org/mozilla-central/source/netwerk/base/nsPACMan.cpp) and [bug 356831](https://bugzilla.mozilla.org/show_bug.cgi?id=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](https://findproxyforurl.net/wpad/auto-detect/).

## 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)`](https://findproxyforurl.net/findproxyforurl/) 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](https://findproxyforurl.net/rules/pac-over-plain-http/)) |
| Who can supply the file | the server you configured | the first DHCP answer on the segment ([PAC-D008](https://findproxyforurl.net/rules/dhcp-option-252/)), or whoever answers the `wpad` name ([PAC-D007](https://findproxyforurl.net/rules/wpad-dns-discovery/)) |
| 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 `wpad` record in
  every internal DNS suffix, block `wpad.*` 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](https://findproxyforurl.net/generate/wpad-dat/) or the
[PAC file generator](https://findproxyforurl.net/generate/), or copy one of the [PAC file examples](https://findproxyforurl.net/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 for
  `wpad` outside your organisation. Public `wpad` names have been registered and abused; the 2016
  US-CERT alert TA16-144A documents the name-collision attacks. See
  [PAC-D007](https://findproxyforurl.net/rules/wpad-dns-discovery/) and the page on [the wpad DNS record](https://findproxyforurl.net/articles/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](https://findproxyforurl.net/rules/pac-over-plain-http/).
- **DHCP is unauthenticated.** Any device that answers DHCP on the segment can hand out its own
  PAC URL ([PAC-D008](https://findproxyforurl.net/rules/dhcp-option-252/)).
- **Windows also asks the local network.** When DNS has no `wpad` name, Windows 11 also asks the
  local segment through mDNS, NetBIOS and LLMNR, and any device there can answer. The page
  [the wpad DNS record](https://findproxyforurl.net/articles/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](https://findproxyforurl.net/articles/should-you-still-use-a-pac-file/).

## Doing it safely

1. 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](https://findproxyforurl.net/wpad/auto-detect/).
2. If you must keep WPAD, create an authoritative `wpad` record in every internal DNS suffix and
   block `wpad.*` lookups to the internet at your resolvers.
3. Serve the file with `Content-Type: application/x-ns-proxy-autoconfig` and an explicit
   `Cache-Control: max-age=…` of at most a day ([PAC-D002](https://findproxyforurl.net/rules/wrong-content-type/),
   [PAC-D003](https://findproxyforurl.net/rules/missing-cache-control/)).
4. Make sure the file ends with an unconditional `return`, so that clients never fall back to a
   direct connection by accident ([PAC-X001](https://findproxyforurl.net/rules/no-default-return/)).

The file itself follows the same rules as any PAC file; they are collected on the page of
[PAC and wpad.dat best practices](https://findproxyforurl.net/best-practices/).

## Testing a wpad.dat

A wpad.dat is an ordinary PAC file, so the [online PAC file tester](https://findproxyforurl.net/check/) works as a WPAD tester
too:

1. Fetch the file the way a client would: `curl -sS -D - http://wpad.corp.example/wpad.dat`.
2. 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.
3. 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](https://findproxyforurl.net/articles/wpad-not-working/) goes through seven checks in the order a client
makes them. Three pages go deeper into one part each:
[DHCP option 252](https://findproxyforurl.net/articles/wpad-dhcp-option-252/) (who reads it and how to set it),
[the wpad DNS record](https://findproxyforurl.net/articles/wpad-dns-record/) (A or CNAME, the Windows block list and the DNS suffixes)
and [resetting the PAC cache](https://findproxyforurl.net/articles/pac-cache-reset/) (what each client keeps after a fix). Problems
inside the file itself are sorted by symptom on the page
[PAC file troubleshooting](https://findproxyforurl.net/articles/pac-file-troubleshooting/).

## References

- [WPAD Internet-Draft, version 00 (June 1999)](https://datatracker.ietf.org/doc/html/draft-ietf-wrec-wpad-00)
  and [version 01 (July 1999)](https://datatracker.ietf.org/doc/html/draft-ietf-wrec-wpad-01)
- [Microsoft: WinHTTP AutoProxy support](https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttp-autoproxy-support)
  and [AutoProxy issues in WinHTTP](https://learn.microsoft.com/en-us/windows/win32/winhttp/autoproxy-issues-in-winhttp)
- [Microsoft: DNS devolution](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee683928(v=ws.10))
- [Apple: VPN proxy settings for Apple devices (WPAD over DHCP and DNS)](https://support.apple.com/guide/deployment/depb78836926/web)
- [Chromium source: pac_file_decider.cc](https://chromium.googlesource.com/chromium/src/+/main/net/proxy_resolution/pac_file_decider.cc)
  and [Firefox source: nsPACMan.cpp](https://searchfox.org/mozilla-central/source/netwerk/base/nsPACMan.cpp)
- [US-CERT TA16-144A: WPAD name collision vulnerability](https://www.us-cert.gov/ncas/alerts/TA16-144A)
- [MDN: Proxy Auto-Configuration (PAC) file](https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/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.



- [Web proxy auto-detection: what "Automatically detect settings" does](https://findproxyforurl.net/wpad/auto-detect/index.md): What "Automatically detect settings" does on Windows 11, 10 and Server, macOS and the browsers, and which wins when a setup script or proxy server is also on.
