Network Troubleshooting Commands

Here are a bunch of useful commands that you can run to help your troubleshoot network programs like connectivity to your default gateway and the internet.

ipconfig /all

ipconfig /all

This command shows a lot of useful information such as your IP address, subnet, gateway and your DNS and DHCP servers.

ipconfig /displaydns

ipconfig /displaydns

This command shows you the DNS cache on your local machine, giving you IP address to name mapping.

ipconfig /flushdns

ipconfig /flushdns

This command will flush the DNS cache on the local machine.

netstat -a

netstat -a

This command will show all the open tcp/udp ports on your machine

arp -a

arp -a

This command will show you your arp cache which gives you IP to MAC address mappings.

tracert -d 8.8.8.8

tracert

This command send a traceroute to 8.8.8.8(google) and show you all the hops the packet took on its way there. The -d option prevents name resolution which speeds up the command.

pathping -n 8.8.8.8

pathping

This command is similar to tracert and will show you all the hops the packet took on its way to 8.8.8.8(google). The -n option prevents name resolution.

nslookup 8.8.8.8

nslookup

This command will give you the hostname of 8.8.8.8(Google) or if used with a hostname will give you the IP address.

nbtstat -a

nbtstat -a 192.168.1.2

This command will give you the NetBIOS name associated with the IP address.