Web proxy automatic discovery (WPAD) is a method that lets devices find proxy server settings automatically through a local DNS lookup or DHCP request. This eliminates the need for manual configuration.
When a device connects to a network, it uses WPAD to locate a proxy auto-config (PAC) file. This file contains JavaScript functions that determine which traffic should go through the proxy and which should bypass it. The PAC file is typically hosted on a web server within the organization.
WPAD operates through a sequence of steps:
WPAD can be implemented in two primary ways:
| Method | Description |
|---|---|
| DNS-based WPAD | The device queries the DNS server for the wpad domain, such as wpad.example.com. |
| DHCP-based WPAD | The device requests the WPAD option from the DHCP server during the IP address assignment process. |
WPAD is also used in educational institutions to filter student internet access. By automatically configuring proxies, schools can enforce content restrictions without manual setup on each device.
One common misconception is that WPAD is solely for web traffic. However, WPAD can also configure proxies for other protocols, such as FTP or SMTP, depending on the PAC file's instructions.
Another misunderstanding is that WPAD is a security feature. While it can improve security by ensuring consistent proxy usage, WPAD itself does not provide encryption or authentication. These features must be implemented separately within the proxy server.
Consider a company with the domain example.com. The IT department sets up a WPAD server at wpad.example.com hosting a PAC file. When an employee's laptop connects to the company network, it performs a DNS lookup for wpad.example.com, downloads the PAC file, and applies the proxy settings specified in the file.
The PAC file might contain rules like:
function FindProxyForURL(url, host) {
if (shExpMatch(host, "*.example.com")) {
return "DIRECT";
} else {
return "PROXY proxy.example.com:8080";
}
}
This script helps traffic to internal sites bypasses the proxy, while all other traffic goes through the proxy server at proxy.example.com on port 8080.
I once configured WPAD for a small business to automate proxy settings for their employees. By setting up a simple PAC file and ensuring the DNS server was correctly configured, we eliminated the need for manual proxy setup on each device, saving time and reducing support requests.