Connectivity and DNS troubleshooting
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.
Ping
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.
IPCONFIG
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.
Hosts File
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.
Routes
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.
Final Thoughts
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.