Network Diagnostics - Dosprompt
Network Diagnostics - Dosprompt
info
When you are on the internet or are working in an networked environment you In the context of
may think you have problems with your network connection. However it would be
this article,
helpful if you could diagnose whether there is a problem and what it is.
"Network" refers
Fortunately there are some useful tools built in to all versions of Windows which
to either a local
can help you, you just need to know what they are and how to use them. This
page explains them and gives you some example of the circumstances when it is network OR
a good idea to use them. your internet
Most of the tools on this page are accessed from the DOS or Command prompt. connection.
While this can look a little scary to a novice user, it can be quite powerful and
allow you to manipulate your system and see what is going on in a a way that isn't possible with nice
looking GUI (Graphic User Interface) tools. However if you are a novice to the Command Prompt, then
you should read our getting started guide (/).
Although you can run these tools from the "Run" box off the start menu, as soon as the command has
finished, the box will close which will stop you from seeing the results. Always open a command box first
and then enter the command there.
Presumptions
This page and the tools listed presume that you have checked that your network settings are entered
correctly - IP address and DNS settings. If you are unsure, you should speak to your network
administrator or internet service provider before continuing. These tools can help you discover if the
settings you have are working correctly, but need something to work from originally.
It also presumes that you have checked your physical connections. Network cables should have a light
flashing indicating a connection. Connections to the Internet should have some kind of indication that the
connection is live.
Getting Help
When working with the tools you can get help by typing the command, then "/?" , e.g.. "ping /?" (minus
the quotes).
ping /? >c:\ping.txt
ping www.dosprompt.info >c:\ping.txt
This sends the results of "ping /?" or the ping to amset.info to a text file in the root of your c: drive called
"ping.txt" which you can view with a text editor like notepad.
Scenario list
To help you choose the tool you need to diagnose your problem, this handy chart outlines some of the
potential problems and which tool will help you diagnose where the problem is.
Ping is probably one of the most used Command Line tools and for good reason. it is a quick and easy
way to see whether the site or service you are trying to connect to is actually alive. It is usually the first
tool most network administrator use when faced with any kind of problem. You can use results from other
actions to carry out further actions in Ping to discovered where the problem may be.
Using Ping
To use ping, simply open a command prompt (/) and enter ping then the name of the host that you want
to check, without the http, ftp etc or any directories, slashes or other information.
ping www.dosprompt.info
ping 85.234.131.90
http://dosprompt.info/network/netdiag.asp 2/9
9/23/2015 Network Diagnostics | dosprompt.info
Infinite Ping
With an additional command you can ask your machine to keep pinging a machine until you end it. This is
useful if you are moving a cable that you think is a problem or you have an intermittent fault.
To continuously ping a host, add the command "-t" to the end after the host. For example:
ping www.dosprompt.info -t
To end the continuous ping, press Ctrl and C which sends a break to it.
Path Ping (Windows XP and Windows 2003 server and higher only)
Path ping is a new tool introduced by Microsoft which combines ping and Trace Route. It analyzes the
route in the same way that trace route does, but sends multiple pings to each hop on the way. It then
collects statistics on this route to tell you whether one particular hop is being very slow, indicating a
problem. This does make it a slower tool than ping, but can provide more information useful for diagnosis.
Using pathping is very similar to the standard ping application. In a command prompt enter the command
"pathping" then the host or Ip address that you want to check. For example:
pathping www.dosprompt.info
pathping 85.234.131.90
After pressing enter you will get one of two results. Either "unable to resolve target" which means that the
name doesn't exist or the pathping will begin, only to end with a successful or failure result code. Refer to
the tracert results table below for information on these result codes.
If the process seems to be going on too long, then press Ctrl and C to end it.
More information on pathping can be found in the online Windows Help system.
Netsh Ping
You can also ping through the Netshell interface, allowing you to ping certain servers and settings that
are configured on your machine. See the netsh section below for more information on this powerful
application.
Trace Route
http://dosprompt.info/network/netdiag.asp 3/9
9/23/2015 Network Diagnostics | dosprompt.info
Trace Route
When you browse the Internet, your machine doesn't not connect directly to the other site, it goes
through many hops. This can be as few as one or two if you are connecting to the web servers internally
or at your internet service provider, to as many as 30 if you are browsing to a web site hosted on the
other side of the world. In most cases you don't need to worry about how many hops you go through. the
ISP will be routing your traffic to the required host, possible over a number of routes to ensure that your
request reaches it and the reply gets back.
What Trace Route does is show you the route that it is taking.
If you are getting a problem where you cannot connect to a certain site, trace route can help you
diagnose whether it is a local problem, an ISP problem or a wider issue.
tracert www.dosprompt.info
tracert 85.234.131.90
After pressing enter, the trace will either fail immediately, or you will get one of the following result codes:
** If you get this immediately then your internal routing is at fault. If it occurs after three or four hops then
it is probably outside of your control.
If the problem is a hop outside of your ISP, there is very little that you can do. Hopefully the problem will
be resolved or routers will find an alternative route around the problematic machine.
More information on tracert can be found in the online Windows Help system.
Netstat
http://dosprompt.info/network/netdiag.asp 4/9
9/23/2015 Network Diagnostics | dosprompt.info
Net Stat is a tool that tells you what your machine is connected to at the moment the command is run.
This makes it a very useful tool to see if your machine is connecting to servers that you don't know about
- possibly via the so called "Spy Ware" or "Ad Ware". By adjusting the switches after the command you
can change the way the information is presented.
This tool can display information about the active connections, as well as whether the machine is listening
for connections - i.e. ready to receive a connection from another machine.
Command Displays
netstat Active connections only, with the full domain name
netstat -a Active connections and listening ports with full domain name
Active connections and listening ports with full domain name and PID of application
netstat -ao
using it*
netstart -an Active connections and listening ports but in numeric form (no domain names)
Active connections and listening ports but in numeric form (no domain names) and
netstat -ano
PID of application using it*
Repeats the command, updating the statistics after the number of seconds
netstat -<any of indicated.
above> 30 Change the number to increase or decrease the frequency
Replace <any of the above> with either "a", "ao", "an" or "ano"
* By adding the PID (Process Identification) you can see which application or service running on your
machine is making the connection or is in a waiting state. To see the lists of processes, start the Task
Manger (CTRL - ALT - DELETE then press Task manager, Right click on the taskbar and choose it from
the options or press CTRL ALT ESC).
Once Task manager is loaded, if you cannot see PID in the list of columns, add it from the "View", "Select
Columns" command.
PortInformation
25 SMTP Server - email server
80 Web server
110 POP3 Server - email server
If you see other ports that you want to check and the PID doesn't clarify their use then you can look at the
official list maintained by the IANA (Internet Assigned Numbers Authority) here:
http://www.iana.org/assignments/port-numbers (http://www.iana.org/assignments/port-numbers) . This
lists the most common port usage but is reliant on application providers registering the port use.
You could also do a search on Google for the word "port" and then the number to see if anyone else has
reported it or can tell you what it is.
More information on netstat can be found in the online Windows Help system.
Net Shell
http://dosprompt.info/network/netdiag.asp 5/9
9/23/2015 Network Diagnostics | dosprompt.info
Net Shell
With the latest versions of Windows, the TCP/IP component is core to the operating system and therefore
cannot be reinstalled, removed or disabled. This makes resolving problems with it a little more complex
than before. Microsoft introduced with Windows 2000 a new utility that runs from the command line to
allow you to adjust and diagnose the IP settings. This new command is called netsh (net shell). It takes
preset commands, looks at what is configured in the operating system for those settings then uses them.
Therefore you are testing the network settings as the operating system sees them.
There are two ways to operate the Netsh commands, both of which require a command prompt.
If you going to be running lots of commands or want to look at the help files for subcommands, then
method 2 is the better choice.
When you are in the netsh command shell, the prompt changes from "c:\>" to "netsh>"
Action Command
Try to connect to the mail server configured in Outlook Express diag connect mail
Try to connect to the news server configured in Outlook Express diag connect news
Try to connect to the Internet Explorer Proxy server (if
diag connect ieproxy
configured)
diag connect iphost <name> <port>
Try to connect to a specific port on an IP address or host name diag connect iphost <ip address>
<port>
Show network configuration diag show all
Ping servers configured on your machine
diag ping <server type>
(run diag ping alone for the list of available server types)
Show the graphical interface diag gui
DNS
http://dosprompt.info/network/netdiag.asp 6/9
9/23/2015 Network Diagnostics | dosprompt.info
DNS is core to the operation of most networks and the Internet. It stands for Domain Name Service and
the best way to think of it is like a big phone book. Every machine on the Internet has a unique IP
address. DNS maps those addresses to friendly names. For example www.bbc.co.uk is 212.58.224.125.
Therefore if you are having problems with DNS settings or DNS lookups, it can hinder your web browsing.
If you are getting errors when browsing about hosts not being found, especially of they are popular sites
like Microsoft, Yahoo or the BBC then your DNS could be at fault.
The first thing you should do is flush your DNS cache. This very simple, just start a command prompt and
enter the following text:
ipconfig /flushdns
This will clean out the cache held on your local machine forcing it to look to the servers you have
configured in your settings.
DNS Lookup
DNS lookups can be carried out from the command line using a tool called "nslookup". This tool doesn't
have online help without entering the main shell.
A name lookup will tell you whether:
To do a DNS lookup from a command line, open a command prompt and enter the following command:
for example
nslookup www.bbc.co.uk
You can also do DNS lookups against other servers that don't belong to your ISP. This can verify whether
your ISP has a problem. If you are running internal DNS servers (for example on a network) then using
external DNS servers can be beneficial in discovering if the problem is local or not. To do this you need to
enter the "nslookup" shell. Open a command prompt and just type "nslookup" (minus the quotes) and
press enter. You will be told what server you are currently using for DNS.
To change server enter the command "server" then the IP address of the alternative DNS server that you
want to use.
Then, to look up a host, just enter the name, for example www.bbc.co.uk .
http://dosprompt.info/network/netdiag.asp 7/9
9/23/2015 Network Diagnostics | dosprompt.info
set type=mx
An example of using nslookup and telnet together to test MX records and an email server is here
(mx.example.asp).
When you have finished, type exit to leave the nslookup shell.
More information on nslookup can be found in the online Windows Help system.
WHOIS
WHOIS, which allows you to lookup information about a domain name, is not native to Windows.
You can download a command line WHOIS tool from the Microsoft Sysinternals
(http://technet.microsoft.com/hi-in/sysinternals/bb897435(en-us).aspx) site.
Extract the files, then place them in to \windows\system32. The command will then be available to you in a
standard prompt.
WHOISIP
To do the same as above, but for IP addresses, there is another tool called WHOISIP which can be
downloaded from here: http://www.nirsoft.net/utils/whosip.html (http://www.nirsoft.net/utils/whosip.html) . As
with the Microsoft tool, extract the file and drop it in to \windows\system32 and you will be able to use it
from a standard prompt.
Telnet
Telnet is how everything on the Internet used to work. It is the way that you connect to UNIX type servers
and is very basic. Therefore it is an excellent way to test your connectivity to hosts on and off your
network.
With the more recent versions of Windows, telnet support from the command line has been introduced.
For older versions of Windows you will to start the application from the start menu.
You can telnet to any port on a machine to see if it is working correctly. The most common telnet action is
to connect to email servers. For example to connect to the email servers for Microsoft you would enter
the following command in a Command Prompt:
telnet maila.microsoft.com 25
http://dosprompt.info/network/netdiag.asp 8/9
9/23/2015 Network Diagnostics | dosprompt.info
By telnetting to a host you can verify whether the port is open and ready to receive connections. If you
cannot connect on the port, then that indicates a problem.
Telnet is not installed by default on Windows Vista, Windows 7, Windows 2008 and Windows 2008 R2. It
needs to be enabled in Windows Components.
More information on Telnet can be found in the TELNET command reference (telnet.asp).
Reproduction of any content on this web site is prohibited without express written consent. Use of this
web site is subject to our terms and conditions (http://www.sembee.co.uk/legal/web-terms.asp).
All trademarks and registered trademarks are property of their respective owners. This site is not
endorsed or recommended by any company or organisation mentioned within and is to provide guidance
only and as such we cannot be held responsible for any consequences of following the advice given.
Sembee Ltd. is registered in England and Wales at 33 Scrivens Mead, Thatcham, Berkshire, RG19 4FQ.
Registered company number: 4704428. VAT Number GB 904 5603 43.
Server 2
http://dosprompt.info/network/netdiag.asp 9/9