Networking/Windows Commands For Troubleshooting

 


When troubleshooting network issues on a Windows system, there are several built-in command-line tools that can help you diagnose and resolve problems. Below are some of the most commonly used networking commands:

1. ping

Purpose: Tests connectivity between your computer and a target IP address or hostname.

  • Usageping <IP_address_or_hostname>
  • Exampleping google.com
  • Useful Options:
    • -t: Continuous ping (use Ctrl+C to stop).
    • -n <count>: Number of echo requests to send.
    • -l <size>: Size of the packet to send.

2. ipconfig

Purpose: Displays the current TCP/IP network configuration, including IP address, subnet mask, and default gateway.

  • Usageipconfig
  • Useful Options:
    • /all: Displays detailed information.
    • /release: Releases the IP address for the specified adapter.
    • /renew: Renews the IP address for the specified adapter.
    • /flushdns: Clears the DNS resolver cache.

3. tracert

Purpose: Traces the route packets take to reach a destination, showing each hop along the way.

  • Usagetracert <IP_address_or_hostname>
  • Exampletracert google.com
  • Useful Options:
    • -d: Prevents resolution of IP addresses to hostnames (speeds up the trace).

4. netstat

Purpose: Displays active connections, listening ports, and network statistics.

  • Usagenetstat
  • Useful Options:
    • -a: Displays all connections and listening ports.
    • -n: Displays addresses and port numbers in numerical form.
    • -b: Displays the executable involved in creating each connection.
    • -r: Displays the routing table.

5. nslookup

Purpose: Queries DNS to obtain domain name or IP address mapping.

  • Usagenslookup <domain_name_or_IP_address>
  • Examplenslookup google.com
  • Useful Options:
    • -type=<record_type>: Queries a specific DNS record type (e.g., MXACNAME).

6. pathping

Purpose: Combines the functionality of ping and tracert to provide more detailed information about network latency and packet loss.

  • Usagepathping <IP_address_or_hostname>
  • Examplepathping google.com

7. arp

Purpose: Displays and modifies the IP-to-Physical address translation tables used by the Address Resolution Protocol (ARP).

  • Usagearp -a
  • Useful Options:
    • -a: Displays current ARP entries.
    • -d: Deletes a specific ARP entry.
    • -s: Adds a static ARP entry.

8. route

Purpose: Displays and modifies the local IP routing table.

  • Usageroute print
  • Useful Options:
    • print: Displays the routing table.
    • add: Adds a route.
    • delete: Deletes a route.
    • change: Modifies an existing route.

9. netsh

Purpose: A powerful command-line scripting utility that allows you to display or modify the network configuration of a computer.

  • Usagenetsh
  • Common Commands:
    • netsh interface ip show config: Displays IP configuration.
    • netsh interface ip set address: Sets a static IP address.
    • netsh winsock reset: Resets the Winsock catalog (useful for fixing network connectivity issues).

10. getmac

Purpose: Displays the MAC address of all network adapters on the system.

  • Usagegetmac
  • Useful Options:
    • /v: Displays detailed information.

11. telnet

Purpose: Tests connectivity to a specific port on a remote host.

  • Usagetelnet <IP_address_or_hostname> <port>
  • Exampletelnet google.com 80
  • Note: Telnet client may need to be enabled via "Turn Windows features on or off."

12. ftp

Purpose: Transfers files to and from a remote FTP server.

  • Usageftp <IP_address_or_hostname>
  • Exampleftp ftp.example.com

13. ssh

Purpose: Connects to a remote system using the Secure Shell (SSH) protocol.

  • Usagessh <username>@<IP_address_or_hostname>
  • Examplessh user@192.168.1.1

14. scp

Purpose: Securely copies files between hosts over SSH.

  • Usagescp <source> <destination>
  • Examplescp file.txt user@192.168.1.1:/path/to/destination

15. systeminfo

Purpose: Displays detailed system information, including network information.

  • Usagesysteminfo

16. tasklist

Purpose: Displays a list of currently running processes.

  • Usagetasklist
  • Useful Options:
    • /svc: Displays services hosted in each process.

17. taskkill

Purpose: Terminates tasks by process ID (PID) or image name.

  • Usagetaskkill /PID <process_id> or taskkill /IM <image_name>
  • Exampletaskkill /IM notepad.exe

18. wmic

Purpose: Windows Management Instrumentation Command-line utility for system information and management.

  • Usagewmic
  • Examplewmic nic get netconnectionid (lists network adapters)

19. powershell

Purpose: Advanced scripting and command-line tool for Windows.

  • Usagepowershell
  • ExampleTest-NetConnection <IP_address_or_hostname> -Port <port> (tests connectivity to a specific port)

20. Test-NetConnection (PowerShell)

Purpose: Tests network connectivity, including port availability.

  • UsageTest-NetConnection <IP_address_or_hostname> -Port <port>
  • ExampleTest-NetConnection google.com -Port 80

These commands can be used in combination to diagnose and resolve a wide range of network issues on a Windows system. Always run the Command Prompt or PowerShell as an administrator for full functionality.

 

Previous Post Next Post

نموذج الاتصال