CMD Commands for Network
Troubleshooting
1. Basic Network Information and Configuration
• ipconfig: Displays IP configuration details of all network adapters.
ipconfig
• ipconfig /all: Shows detailed information, including DNS, DHCP, and MAC addresses.
ipconfig /all
• ipconfig /release: Releases the current IP address of a network adapter.
ipconfig /release
• ipconfig /renew: Renews the IP address for a network adapter.
ipconfig /renew
• ipconfig /flushdns: Clears the DNS cache.
ipconfig /flushdns
• ipconfig /displaydns: Displays the contents of the DNS cache.
ipconfig /displaydns
2. Network Connections and Routes
• ping [hostname/IP]: Sends ICMP echo requests to test the connectivity to a host.
ping google.com
• tracert [hostname/IP]: Traces the route to a remote host to identify where a network
delay or failure occurs.
tracert google.com
• pathping [hostname/IP]: Combines ping and tracert by providing information on the
network route and packet loss at each hop.
pathping google.com
• netstat -an: Displays active TCP/IP connections, listening ports, and the state of each
connection.
netstat -an
• route print: Shows the current IP routing table.
route print
• arp -a: Displays the ARP (Address Resolution Protocol) table, which maps IP addresses to
MAC addresses.
arp -a
3. DNS and Name Resolution
• nslookup [hostname]: Queries the DNS for the IP address of a hostname or vice versa.
nslookup google.com
• netsh interface ip set dns "[adapter]" static [DNS IP]: Configures a static DNS server for a
network adapter.
netsh interface ip set dns "Ethernet" static 8.8.8.8
4. Network Adapter Management
• netsh interface show interface: Displays the state of network adapters (enabled/disabled).
netsh interface show interface
• netsh interface set interface "[adapter]" enable/disable: Enables or disables a network
adapter.
netsh interface set interface "Ethernet" disable
5. Wi-Fi and Wireless Network
• netsh wlan show profile: Lists all saved Wi-Fi networks.
netsh wlan show profile
• netsh wlan show profile [SSID] key=clear: Displays Wi-Fi network details, including the
saved password.
netsh wlan show profile MyWiFi key=clear
• netsh wlan show networks: Lists available Wi-Fi networks.
netsh wlan show networks
6. Firewall and Port Management
• netsh advfirewall show allprofiles: Displays the firewall status for all profiles.
netsh advfirewall show allprofiles
• netsh advfirewall set allprofiles state on/off: Enables or disables the firewall for all
profiles.
netsh advfirewall set allprofiles state off
7. Diagnosing Network Issues
• netsh int ip reset: Resets the TCP/IP stack to its default state.
netsh int ip reset
• netsh winsock reset: Resets the Winsock catalog to resolve issues related to network stack
corruption.
netsh winsock reset