Due to demand for the original PortCheck tool, I decided to release the updated version that I myself have been using that has a few more features to help diagnose connectivity issues.
The idea behind PortCheck was simple – help diagnose the common “page cannot be displayed” or “server not found” errors that could result from a number of network connectivity, or service availability issues.
In my post on the subject, Where did my IIS7 server go? Troubleshooting “server not found” errors, I listed some of the common causes for these errors, which include:
1) You misspelled the hostname
2) The hostname doesn’t exist
3) You are unable to resolve the server hostname to an IP address (DNS server connectivity)
4) You don’t have network connectivity to the server
5) Firewall is blocking your connection
6) IIS is not running
7) The Web site doesn’t exist
8) The Web site is stopped
9) The Web site does not have the binding on which you are trying to connect
The PING command is commonly used to help with 1-4, but when it comes to 4-8, it falls short because it doesn’t actually verify that the server is listening at the port at which you are trying to connect.
PortCheck bridges this gap by actually attempting to make a connection to the specified port.
In the current release of PortCheck, I added more diagnostics to help pinpoint the exact problem along the network route. The tool now does the following:
1) Resolve the address provided to all available IP addresses, and associated hostnames.
a. If failed, you have problems 1-3 on your hands
2) Attempt to connect to the specified port
a. If failed, PING the specified host
i. If failed, you most likely have problems 4-5: limited network connectivity, or firewall is blocking access (including ICMP). But, it could also be that firewall is blocking PING (ICMP), and you have problems 5-9 as well.
ii. If successful, you most likely have problems 5-9: firewall is blocking access to the port, IIS isn’t running, Web site is stopped or missing, or not listening at the specified address.
For example:
> PortCheck.exe zzz.mvolo.com 80
DNS LOOKUP FAILED (162 ms)
Most likely causes:
Host hostname / address does not exist (check spelling)
DNS is down or cannot connect to DNS server (try from another machine)
> PortCheck.exe www.mvolo.com 81
Resolved www.mvolo.com (220 ms)
Hostnames:
www.mvolo.com
IP addresses:
209.162.178.14
CONNECTION TO www.mvolo.com:81 FAILED (21001 ms): A connection attempt failed be
cause the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 209.162.178.14:81
PING REPLY (0 ms): TimedOut
The host may be unreachable. Most likely causes:
No network connectivity to host
No service active on that port
Blocked by remote firewall
Blocked by local or network firewall
Now, if PortCheck fails to make the connection, you still need to investigate what is happening at the server, which may require checking whether IIS is running, whether firewall is open, and whether the web site you are accessing exists, is started, and is listening at the right port. This requires administrative access to the server, and the steps you can find in Where did my IIS7 server go? Troubleshooting “server not found” errors.
In the next release of PortCheck, I will add some diagnostics that (assuming you are running as Administrator for the remote machine) can perform those diagnostics for you so the picture can be complete.
NOTE: PortCheck 2.0 is released under the MPL (Microsoft Permissive Use License).
[Download PortCheck v2.0]
[Download Source Code v2.0]
Enjoy,
Mike
Anonymous
Due to demand for the original PortCheck tool , I decided to release the updated version that I myself
Anonymous
Mike Volodarsky has updated his PortCheck tool to version 2.0. The tool is simple, but quick to troubleshoot connections against web sites.
Anonymous
A slight bug – your code allows for either two or three arguments (address, port, timeout), but the tool exits if a third argument is supplied:
if (args.Length != 2)
{
Console.Error.WriteLine(“Usage: PortCheck address port [timeout]”);
return;
}
Anonymous
Great troubleshooting tool!
Mike Volodarsky
Richard,
Great catch! I got a little sloppy with cleaning up source code. The timeout attribute is actually not supported, its left over from an “in-progress” version of the tool (v. 3) 🙂
I’ll update the source code today. Thanks for the heads up!
Thanks,
Mike
Anonymous
Hi Mike,
One thing I noticed that Portcheck does not do is IP addresses. It comes back with a “DNS LOOKUP FAILED”. It would be nice if it could do it as I sometimes like to test when setting up a site before I make DNS changes.
Thanks,
JJ
Mike Volodarsky
I updated the tool with the fix for the unsupported timeout parameter (removed) and fixed it to be able to use ip addresses.
Richard, JJ, thanks for reporting the bugs!
Thanks,
Mike
Anonymous
The IIS 7.0 Resource Kit Book is finally out! Ok, it’s been out for almost 2 months, but somehow
Anonymous
This is a great site, I only wish I had found it sooner.
Anonymous
Follow all the instruction from this page. Every thing is going fine but still cause error 404 File or directory not found when i am accessing my website on lan
Anonymous
fixing problem
Anonymous
suppose you have a data file named importfile.csv that contains 3 comma separated columns of data on each line. You want to import this textfile into your MySQL table named test_table
vb2011
im still having an error 404 file problem
Keith
Mike, is there any way to still get version 2.0 of portcheck.exe?
Mike
Late response, but I just realized the link to the .exe version of PortCheck was broken. Its fixed now.
Best,
Mike
Charlie Arehart
Thanks for all the great resources, Mike.
Just a heads-up: the link to your “where did my iis 7 server go” article at the opening of this entry has a botched URL which fails (well, it dumps us on the front page of your site). I dug around and find the correct URL, for other readers:
http://mvolo.com/where-did-my-iis7-server-go-troubleshooting-quotserver-not-foundquot-errors/
Charlie Arehart
Ah, and not only is that listed twice (if you may want to correct it), but also the “download” link you offer (after the first paragraph) is also failing. I see now that it’s just a link to this entry itself, dropping folks down to the #download anchor, but since you’ve changed the location for your blog since back then, and the URL is hard-coded, it fails (again drops us on the front page of the blog). The corrected link should of course be:
mvolo.com/check-iis-network-connectivity-with-portcheck-v20#download
Hope that’s helpful to you/other readers.