Proxy auto-configuration for Windows and Linux

Operation systems generally can digest and look for a PAC file (="proxy auto-config"). They look for it using WPAD (="web proxy auto-discovery protocol").

Windows 7 and 8 do that. Ubuntu can do that (can be activated within the Network settings). For Fedora and Korora it's the same.

The PAC file can look like this one which provides "PAC with network and domain whitelisting".

For WPAD to work automatically the file should be served using the the MIME type application/x-ns-proxy-autoconfig. Its location should be announced via DHCP and DNS.

The DNS should announce either an A record (="host record") or an CNAME for the domain name wpad which should resolv to the IP of the machine that serves the PAC file. All in all it should be possible to access it over port 80 using http://wpad.[local_domain]/proxy.pac.

Using DHCP the file can be made available using any address and port. On a Linux machine the responsible configuration file /etc/dhcp/dhcpd.conf could look like this:

option local-proxy-config code 252 = text;  
...
subnet 192.168.0.0 netmask 255.255.255.0 {  
  range 192.168.0.100 192.168.0.200;
  ...
  option local-proxy-config "http://www.example.org/proxy.pac";
}

References
- Web Proxy Autodiscovery Protocol (wikipedia.org)
- Configuring Web proxy clients... (technet.microsoft.com)

The author

Written by Per

Free software enthusiast and transhumanist residing in Stuttgart, Germany.


comments powered by Disqus