How To Troubleshoot Network Issues
When troubleshooting network issues you must always test locally on the server using "localhost" first (not the IP or name - "localhost" only), and only when that works move outwards to other servers, and finally the load balancer so you don't waste time troubleshooting from the outside to find it doesn't even work locally.
Computer Name on Windows Server
To get the current computer name on a Windows system via Command Prompt or PowerShell:
hostname
Current Username on Windows Server
To get the name of the user that the Command Prompt or PowerShell window is running as on a Windows system:
whoami
Network Configuration on Windows Server
To see what network adapters there are along with their IP addresses, Gateway, and DNS servers on a Windows system via PowerShell:
Get-NetIPConfiguration
Listening Ports on Windows Server
To see what TCP and UDP ports are being listened on by what processes on a Windows system via Command Prompt or PowerShell:
netstat -ano
Note: Process ID "4" is the Windows HTTP.sys infrastructure used by any process that listens on HTTP (so for HTTP ports you cannot see which process it is using it because multiple processes can share the ports)
Test TCP port connectivity
To test connecting to a TCP port from a computer:
On Windows (via PowerShell)
Test-NetConnection HostOrIP -Port PortNumber
Example:
Test-NetConnection www.sureviewsystems.com -Port 443
On Mac (via Terminal)
nc -vz HostOrIP PortNumber
Example:
nc -vz www.sureviewsystems.com 443
Test TCP port communication
To connect to a TCP port and receive any data being sent and optionally send data back use the following command:
On Windows
telnet HostOrIP PortNumber
telnet HostOrIP PortNumber -f FileToLogAllOutputTo.txt
Examples:
telnet www.sureviewsystems.com 443
telnet www.sureviewsystems.com 443 -f MyLog.txt
If you connect then the screen will go blank and you will see anything being sent by the other end. When you are finished, press Ctrl+] and then type "quit" to disconnect
NOTE: if you get an error about failing to connect then the given port is not being listened on or is blocked.
NOTE: if you get an error about telnet not being a recognized command or program then you do not have the Windows Feature installed - to install it run the following command:
dism /online /Enable-Feature /FeatureName:TelnetClient
Test DNS resolution
To see what the result of looking up a hostname from DNS is (the result will list what IP addresses it resolves to, or an error if the name does not exist):
On Windows (via PowerShell)
Resolve-DnsName Hostname
Example:
Resolve-DnsName www.sureviewsystems.com
On Mac (via Terminal)
host Hostname
Example:
host www.sureviewsystems.com
Comments
0 comments
Please sign in to leave a comment.