How do I retrieve the PAC script using WPAD on OSX? is it enough to fetch the contents of \"http://wpad/wpad.dat\" in hopes that the DNS has \"wpad\" pre-configured for this co
See section 8 of the WPAD draft on compliance. Using only DNS as you suggest would make you "minimally compliant".
To be fully compliant, you should check to see if the host has received WPAD configuration from DHCP prior to using DNS. You should be able to use the System Configuration framework to see if the host received an option 252 parameter from the DHCP server.
EDIT: Actually, you can get the WPAD URL directly from the system configuration framework. Looks like you'd be interested in kSCPropNetProxiesProxyAutoConfigEnable
, and if that's set to 1
, the WPAD URL should be in kSCPropNetProxiesProxyAutoConfigURLString
.