NETWORKING COMMANDS:
1. ping
• What it does: Checks if a device or server is reachable over the network by sending
ICMP packets.
• Use cases:
o Test network connectivity to a specific host.
o Measure response time (latency).
2. netstat
• What it does: Displays network connections, routing tables, and active ports on your
system.
• Use cases:
o Check which ports are open and in use.
o Identify active connections to/from your system.
o Troubleshoot network issues.
3. ifconfig
• What it does: Shows or configures the network interfaces on a system.
• Use cases:
o View IP addresses of network interfaces.
o Enable or disable an interface.
o Change IP address manually. (Note: replaced by ip command in modern
systems.)
4. traceroute
• What it does: Tracks the path packets take to reach a specific destination, listing each
hop.
• Use cases:
o Diagnose where network delays or failures occur.
o Understand the routing path to a server.
5. mtr (My Traceroute)
• What it does: Combines ping and traceroute to provide real-time packet loss and
latency reports.
• Use cases:
o Identify network performance issues.
o Continuously monitor latency and loss at each hop.
6. nslookup
• What it does: Queries DNS servers to get domain name to IP address mappings.
• Use cases:
o Find the IP address of a domain.
o Troubleshoot DNS issues.
7. Reverse Lookup (using nslookup or similar tools)
• What it does: Finds the domain name associated with an IP address.
• Use cases:
o Verify the domain behind an IP address.
o Investigate suspicious IPs.
8. telnet
• What it does: Connects to remote servers on a specific port to test connectivity.
• Use cases:
o Check if a port is open on a server.
o Debug plain-text communication protocols (e.g., SMTP, HTTP).
(Note: It's insecure; use alternatives like SSH for secure connections.)
9. dig (Domain Information Groper)
• What it does: Performs DNS lookups, providing detailed query and response
information.
• Use cases:
o Check DNS records (A, CNAME, MX, etc.).
o Test how DNS servers resolve domains.
10. whois
• What it does: Queries information about domain registrations and owners.
• Use cases:
o Find out who owns a domain.
o Check domain expiry or registration details.
11. curl
• What it does: Transfers data from or to a server using various protocols (HTTP, FTP,
etc.).
• Use cases:
o Test APIs.
o Download or send data from/to a server.
o Fetch website content programmatically.
12. wget
• What it does: Downloads files from the web using HTTP, HTTPS, or FTP.
• Use cases:
o Download large files or entire websites for offline use.
o Automate file downloads in scripts.
EXAMPLES FOR EACH NETWORKING TOOL:
1. ping
• Example:
ping google.com
Explanation: This sends packets to google.com to check if it's reachable and measures the
response time.
2. netstat
• Example:
netstat -tuln
Explanation: Shows all active listening ports (-t for TCP, -u for UDP, -l for listening ports, -n
to show numeric addresses).
3. ifconfig
• Example:
ifconfig
Explanation: Displays the configuration of all network interfaces, including IP addresses and
status.
4. traceroute
• Example:
traceroute google.com
Explanation: Traces the path from your computer to google.com, showing each hop along
the way.
5. mtr
• Example:
mtr google.com
Explanation: Provides a real-time, continuous trace to google.com with latency and packet
loss stats.
6. nslookup
• Example:
nslookup google.com
Explanation: Queries DNS to find the IP address associated with google.com.
7. Reverse Lookup (using nslookup)
• Example:
nslookup 8.8.8.8
Explanation: Looks up the domain name associated with the IP address 8.8.8.8 (Google's
DNS server).
8. telnet
• Example:
telnet google.com 80
Explanation: Connects to google.com on port 80 (HTTP) to test if the port is open and
accessible.
9. dig
• Example:
dig google.com
Explanation: Performs a detailed DNS query for google.com, including IP addresses and
other DNS records
10. whois
• Example:
whois google.com
Explanation: Retrieves information about the domain google.com, including the owner,
registrar, and expiration date.
11. curl
• Example:
curl https://jsonplaceholder.typicode.com/todos/1
Explanation: Fetches data from a sample API (JSON format) from jsonplaceholder and
prints it to the terminal.
12. wget
• Example:
wget https://example.com/file.zip
Explanation: Downloads the file file.zip from example.com to your current directory.