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:
NETSH DIAG PING ADAPTER
Hit Enter and then sit back and watch as the magic happens. (IP Addresses have been removed.)
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:
NETSH DIAG PING ADAPTER > C:\LanPing.txt
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 LOOPBACK - Ping 127.0.0.0
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.