A comprehensive guide to essential networking commands used for troubleshooting, configuration, and diagnostics. Learn how to analyze and manage networks efficiently.
ping
- Checking Network Connectivityping
command is used to test the reachability of a host on an IP network by sending ICMP Echo Request packets.
Example:
traceroute
/ tracert
- Tracing Network Routestraceroute
(Linux/macOS) or tracert
(Windows) displays the path packets take to reach a destination.
Example:
ipconfig
/ ifconfig
- Displaying IP Configurationipconfig
displays network settings.ifconfig
(deprecated, use ip a
) shows IP configuration.netstat
- Viewing Network Connectionsnetstat
command provides detailed information about active network connections, listening ports, and routing tables.
Example:
nslookup
- Querying DNS Recordsnslookup
is used to find the IP address of a domain name and troubleshoot DNS issues.
Example:
dig
- Advanced DNS Queriesdig
is a powerful DNS lookup tool available on Linux/macOS.
Example:
arp
- Viewing ARP Cachearp
command shows or manipulates the ARP table, which stores IP-to-MAC address mappings.
Example:
route
- Managing Routing Tablesroute
command displays and modifies the routing table.
Example:
hostname
- Displaying Hostnamehostname
command prints the system’s hostname.
Example:
curl
& wget
- Fetching Web Contentcurl
and wget
retrieve web content via HTTP/S.