Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WPAD.DAT
#1
Using wpad.dat negates the need to type proxy settings directly into a browser. It also allows continued use of the Internet away from site as it looks to see if you are connected either to a specific domain or IP range. 

There are three stages to making this work.

Stage 1 - IIS Settings
Since the web browser is trying to fetch the configuration file (wpad.dat) by using the HTTP protocol, the hosting 
server should be able to do so. The hosting web server must be also set to serve .dat files as “application/x-ns-proxy-autoconfig” mime types and the wpad.dat file should be located at the web site’s root directory. For example in an IIS configuration, you should do the following:
  • Go to Start –> settings –> control panel –> administrative tools –> Internet Information Services (IIS) Manager
  • Click the web site node in which you are going to host the wpad.dat file (for example Default Web Site) and the properties appear in the right pane.
  • Select the MIME Types icon
  • In the “MIME Types” dialog box, right click and ADD type .dat in the extension field and application/x-ns-proxy-autoconfig in the MIME Type field, and press OK.
  • Return back to IIS Manager and right click the web site node in which you are going to host the wpad.dat file (for example Default Web Site) and select explore.
  • Right click somewhere in the right pane of the IIS snap-in and select new –> text document.
  • Rename the document to wpad.dat.
Stage 2 - Edit wpad.dat
  • Right click the wpad.dat file crated above and type the following.
function FindProxyForURL(url, host)

{
//Ok so this bit ensures that any local domains don't go out via a Proxy
if (shExpMatch(host,"*.stmarys.local"))
{
return "DIRECT";
}
//This bit makes sure that devices such as printers can be accessed if they are on the local IP range
if (isInNet(host, "10.17.81.0", "255.255.255.0"))
{
return "DIRECT";
}
//Finally after the exclusions we can send all traffic via a proxy.
return "PROXY surfprotect.exa-networks.co.uk:3128; DIRECT";
}

The narrative is self explanatory for the exceptions (DIRECT) commands. The proxy settings can be changed to suit the environment. For example RM uses segfl.ifl.net:8080

Stage 3 - Add it to either DNS or DHCP  
  • For DNS, add a A record pointing back to either the IIS Server's IP or FQDN.
  • For DHCP (Preferred)
    • Go to Start –> settings –> control panel –> administrative tools –> DHCP
    • Right click the DHCP server name and select “set predefined options”
    • In the Predefined options dialog box press “add”
    • In the option type dialog box set the following values:
      Name: WPAD
      Data Type: String
      Code: 252
      Description: WPAD Auto Config Key
    • Go back to DHCP snap-in and right click either your scope or server options.
    • Select “Configure Options…”
    • In the scope options dialog box select the 252 option and in the string value type your wpad.dat file location such as the IIS FQDN or IIS Server IP address and press OK.

Credit WPAD.DAT
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)