How do I know what proxy server I'm using?

810,185

Solution 1

The auto proxy detection system works by downloading a file called wpad.dat from the host wpad. First confirm this host exists from a command prompt:

ping wpad

If it doesn't exist, you may have to put the correct DNS suffix. In the same command prompt, type

ipconfig /all

You should see a Primary DNS Suffix and a DNS Suffix Search List

Try appending each of these with a . to wpad:

ping wpad.<primary dns suffix>

If any of these work, then in your browser enter http://wpad.<suffix>/wpad.dat. This will download the proxy auto configuration file you can open in notepad.exe

Toward the bottom of this file, you should see a line saying

PROXY <host:port>;

It might be repeated if you have multiple proxies available. The host and port are what you need.

If this file doesn't exist, then either there is no proxy server, or the proxy server is being provided by dhcp (note that this would only work with IE, so if firefox can surf, this is not the method being used). If you don't have access to the dhcp server to see what it is sending, the easiest way would be to open a site in ie, then go to a command prompt. Type

netstat -ban

This will provide a list of connections made with the process id of each process. Go to Task Manager, and select View/Select Columns and enable PID (Process Identifier). Look for the PID of iexplore.exe in the list returned by netstat -ban This will reveal the proxy ip and port.

Solution 2

See edit below.

I have one more easy way to find it. Install chrome and go to below URL to see the proxy details

 chrome://net-internals/#proxy

You will be able to see all the details

EDIT September 2020

As stated in the comment by @RMorrisey, you can use the following link (Chrome 85.x.x.x)

chrome://net-export/

Solution 3

Try the following command in cmd:

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxyserver"

Hope helps

Solution 4

The following command also seems to work. As a bonus it avoids contacting lots of DNS servers that might or might not work, and it avoids querying the registry, so it functions even in fairly locked-down environments:

Windows Vista or later:

netsh winhttp show proxy

Windows XP or earlier:

netsh diag connect ieproxy

Some additional work is required to extract the proxy address from the output, so the registry approach is simpler if you know it's going to be available.

Update:

I've found that on windows 7 netsh sometimes returns different results depending on how I call it. If I run the above command manually in a prompt, I get 'Direct Access - No Proxy'. However, calling netsh from SAS results in an actual proxy being listed!

Solution 5

You can also get the automatic configuration file URL from the registry by running:

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Wpad" /s | find /i "WpadDetectedURL"
Share:
810,185

Related videos on Youtube

Mike Christensen
Author by

Mike Christensen

Updated on September 18, 2022

Comments

  • Mike Christensen
    Mike Christensen over 1 year

    I need to know what the address for my proxy server is so I can configure another program to also use it. If I go into IE, Internet Properties, LAN Settings, then all I see is an automatic configuration script but not the actual proxy address. How can I get this?

    I'm using Windows XP.

  • Mike Christensen
    Mike Christensen over 12 years
    I tried in both IE and Firefox, neither could find that site.
  • Paul
    Paul over 12 years
    I updated my answer with some more detail...
  • mousio
    mousio over 12 years
    To download the automatic configuration script I find it is easier to just copy and paste the link to the script into the address bar (YMMV)…
  • Paul
    Paul over 12 years
    Yeah good point - I read the OP as using "automatically detect proxy settings", but on a re-read, it looks like you are right, he could just copy and paste the url... it explains why wpad didn't work.
  • Mike Christensen
    Mike Christensen over 12 years
    Yea the problem with that is the domain policy prevents that from being changed, and IE disables the box for the URL. It won't let you copy it or see the entire thing heh.
  • philx_x
    philx_x about 9 years
    sais: Direct access <no proxy server>. but i definetly am behind a proxy .. only shows WinHTTP Proxys
  • user3490
    user3490 about 9 years
    The question is tagged [windows] - are you in a windows environment with a non-WinHTTP proxy?
  • user3490
    user3490 about 9 years
    This is weird - depending on how I call netsh I seem to get any of 3 different answers, all on the same machine...
  • Ben
    Ben almost 9 years
    I'm seeing the "Direct Access" line also. What did you mean by "calling netsh rom SAS"?
  • Ben
    Ben almost 9 years
    In my case, I had to find "AutoConfigURL" instead of "proxyserver". This led me to a *.pac file which I could read through to find the default proxy returned by the script.
  • Ben
    Ben almost 9 years
    Instead of wpad.dat, my proxy configuration apparently uses a "proxy.pac" file that appears in the "use automatic configuration script" section of the LAN settings. This is a script which determines a proxy server to use.
  • Paul
    Paul almost 9 years
    @Ben Hi Ben, that is right, this answer focuses on auto detection, rather than auto configuration. You are welcome to enhance the answer.
  • xmedeko
    xmedeko over 8 years
    netsh winhttp show proxy shows system proxy settings (Default user). A user may have different settings.
  • iaforek
    iaforek over 7 years
    I'm definitely behind a proxy and when I call netsh command I get: "Direct access (no proxy server).". What is SAS?
  • Breandán Dalton
    Breandán Dalton about 7 years
    This solution identified for me that my seemingly direct access to the web was actually being routed through a McAfee web gateway
  • Shiyaz
    Shiyaz about 7 years
    This has a lot more information! Thanks for sharing.
  • zionpi
    zionpi almost 7 years
    This method is very useful when you work with VPN but want to know your network proxy protocol type IP and port.Thanks.
  • GoGoris
    GoGoris almost 7 years
    Although the url didn't work, +1 for linking to the Microsoft documentation
  • DerVO
    DerVO almost 7 years
    so simple and so powerful :)
  • Andrew
    Andrew almost 7 years
    "I think this only applies to application that uses the WinHTTP library. After a quick test, it doesn't seem like any common application on my system uses that." - superuser.com/questions/419696/…
  • Prem
    Prem about 6 years
    Simple and useful
  • Duncan Jones
    Duncan Jones about 6 years
    For me, this was the only answer that showed me my actual proxy address. The others tended to show me where to find a script, which I would have to hand-parse to understand which rules applied to me.
  • Janac Meena
    Janac Meena almost 6 years
    Did not work for me on Windows 10
  • NikoKaranatsios
    NikoKaranatsios over 5 years
    What do you mean by "SAS"?
  • David
    David about 5 years
    Unfortunately, this no longer works; it appears Google has removed the functionality. (I'm on version 73 of Chrome, but I don't know when it was removed -- this isn't something I use every day.)
  • MickyD
    MickyD about 5 years
    This is the only solution that worked for me as of this date
  • StayOnTarget
    StayOnTarget about 5 years
    For me, this screen in Chrome is almost totally blank.
  • StayOnTarget
    StayOnTarget almost 5 years
    What is "SAS" ?
  • StayOnTarget
    StayOnTarget almost 5 years
    This is the same as superuser.com/a/1163035/268750 , which no longer seems to work anyway.
  • Zephan Schroeder
    Zephan Schroeder over 4 years
    > SAS (previously "Statistical Analysis System")[1] is a statistical software suite developed by SAS Institute... per en.wikipedia.org/wiki/SAS_(software) Basically a different application than cmd.exe... therefore can have different proxy configuration than seen in cmd.exe. That's all I know about SAS so I hope that helps :-).
  • Mache
    Mache over 4 years
    This returns empty string for me WpadDetectedUrl REG_SZ
  • saran3h
    saran3h almost 4 years
    Doesnt work anymore
  • saran3h
    saran3h almost 4 years
    Only thing that worked so far.
  • camposer
    camposer over 3 years
    This worked for me, I got the auto config URL, downloaded the PAC file and read proxy config
  • Sam
    Sam over 3 years
    This feature is now replaced by: chrome://net-export/