Troubleshoot network issues with handy Netsh diagnostic command

James Wright shows you a handy Netsh command that allows you to ping the Default Gateway, DHCP Servers, Host IP Address, DNS and WINS Servers (in Search Order) in one fell swoop.

Troubleshooting network issues can be tricky and time consuming. Here I demonstrate a command that can help to speed the process up. This is an old go-to trick for quickly eliminating the local LAN as an issue when troubleshooting network issues on Windows Server 2003 and earlier. (BTW, it also works on Windows XP for you Desktop Support folks.) It is a Command Line tool, or more accurately a NETSH Shell tool, that allows you to ping the Default Gateway, DHCP Servers, Host IP Address, DNS and WINS Servers (in Search Order) in one fell swoop.

At the Command Line type:


Hit Enter and then sit back and watch as the magic happens. (IP Addresses have been removed.)

Figure A

As you can see, you can get a quick glimpse at the basic connectivity of the machine and save yourself some time by not having to ping each of these connections individually. You can also redirect the output of this command, as you can most Command Line tools, to a text file for documentation purposes. To save this information into a text file on the root of C:\ called LanPing.txt, run the command as follows:


You will then have a handy text file for attaching to emails or support tickets, or even for a periodic baseline.

In this case I was using it on a Virtual Machine with only 1 NIC. The command, as written above, will show this information for all enabled NIC's on a machine. If you only want to run this on an individual adapter add one of the following after ADAPTER in the command:

  • The Adapter Index Number (ex. NETSH DIAG PING ADAPTER 2)
  • The Adapter Name (ex. NETSH DIAG PING ADAPTER Wireless Network Connection 2)
  • Or part of the Adapter Name (ex. NETSH DIAG PING ADAPTER Wireless*)

Below are listed some options for the command other that pinging ADAPTER:

NETSH DIAG PING IEPROXY  - Ping Internet Explorer's proxy
NETSH DIAG PING IP       - Ping only the assigned IP Addresses for each adapter
NETSH DIAG PING IPHOST   - Ping a specified IP Address or Host Name
NETSH DIAG PING MAIL     - Outlook Express Mail Server (Not Exchange Servers configured in Outlook)
NETSH DIAG PING NEWS     - Ping the News Server (if configured in Outlook Express)

Well, there is my first trick and I hope it helps you out sometime.


James Wright is a veteran IT professional who has spent the majority of his career as a Systems Administrator. James has also served as a Systems Analyst, Helpdesk Senior Technician and as a Programmer Analyst. This range of experience has allowed hi...


This info was very useful since I'm currently running an XP based system. I will be upgrading to Win 7 in the near future so I'll be looking forward to your next article on the subject.


Good ...But DIAG just don't work in Windows7. You'll get this response: The following command was not found: DIAG PING ADAPTER.


That is really cool. Good find. Do you know if there is an equivalent command for 2008? other than writing a PowerShell script? netsh has no "diag" at all in 2008.


This is because, for reasons only MS knows, the DIAG context was left out with Windows Server 2008 and Windows Vista/7. I will write another article on how to create a script to accomplish this on the newer MS Operating Systems.

Editor's Picks