By far the most prevalent network problem we see in a networked computer environment is either connectivity issues or DNS issues. Usually the two problems are interrelated at some junction. We wanted to go over just a few basic troubleshooting commands that can be used either in the enterprise environment or at home to troubleshoot connectivity issues either to another workstation/pc or the Internet.
The lowly ping command is probably the most commonly used tool to troubleshoot connectivity issues. The concept is very simple. Your workstation sends out an ICMP echo request to a specified hostname or IP address and the end node responds to the ping request with a data packet letting you know that the host is alive or that you can “see” the host from your end. The below result was found by entering the command:
ping -t 192.168.1.1
The “-t” designation for ping is very handy as it tells Windows to basically keep pinging the specified host or IP address indefinitely. If you are troubleshooting connectivity to a specific host, it really helps to not have to keep entering the ping command and keep trying the host when you can initiate the above command to test connectivity.
Many configuration settings can be found by issuing the ipconfig command at a command prompt in Windows. It will tell you the configured IP address for your network adapter(s) as well as other important settings such as your subnet mask, gateway address, and DNS server(s) that are configured on a connection. A couple of really useful switches to be used in conjunction with the ipconfig command are the ipconfig /all and ipconfig /flushdns
Some more advanced information is hidden if you simply issue the ipconfig command. However, the /all command tells Windows to give you everything that is configured for your adapter(s). The DNS server configuration is one piece of valuable information you get with the /all parameter.
The ipconfig /flushdns command is a very useful tool in troubleshooting hostname connectivity issues. If a host has recently changed IP addresses, your workstation or pc may not be aware of that change. Windows keeps a cache of hostnames in its dns resolver cache that it checks first. Most of the time this is not an issue as the IP address to name mappings are correct. However, in the scenerio mentioned, if the cache is stale and has invalid references to incorrect information it will lead to connectivity issues. By issuing the ipconfig /flushdns command you force Windows to empty this cache and pull the latest information from its configured DNS server which should be the latest and greatest information for resolving names to IP addresses provided there is not stale information at that level.
Another useful command in conjunction with the ipconfig command is the net stop dnscache & net start dnscache command. This does what we mention above except it completely restarts the service Windows uses to utilize DNS cache. A few times we have noted in troubleshooting an issue, this resolved the issue where simply issuing the ipconfig /flushdns did not.
Also, it is a good idea to make sure all the values associated with your IP address are correct while looking at the IPCONFIG output. If there is an issue with DNS or your gateway, this could be the culprit also.
Back in the NETBIOS resolution days there was what was known as the hosts file. This file still exists in Windows today, even Windows 7. The hosts files overrides DNS. So you could have a host value entered into your HOSTS file with incorrect information and never be able to get around a connectivity issue by clearing our DNS, etc, by the means we mentioned above. Because you can clear DNS all you want, as the HOSTS file is read first and will take precendence. If you are experiencing connectivity issues that seem to go beyond DNS, the HOSTS file could be your culprit. It is a well known place that many malware variants also alter to interrupt connectivity or reroute your traffic without you knowing it. The hosts file can be edited by going to a command prompt and entering notepad c:\\windows\\system32\\drivers\\etc\\hosts on a Windows XP-Windows 7 box. Simply replace the “windows” directory with your “OS” drive if the above path is not correct.
A stale route can also lead to problems with connectivity. Within Windows use the route print command to view your configured routes as they pertain to your network connections.
We have mentioned just a few of the troubleshooting steps to take when having connectivity issues within a networked Windows environment. There are naturally many other problems that can cause connectivity issues. However, these are a few things that can often lead to successfully pinpointing where the problem exists. Always check the obvious first as most of the time it is the simple problems that may tend to take the longest to discover because we always tend to look for the complicated problems first.