π Network and Connectivity Commands
π Ping (Check Network Connectivity)β
ping <hostname_or_IP>
π Tests if a host is reachable and measures latency.
Example:
ping google.com
Checks if Googleβs servers are reachable and measures response time.
π Traceroute / Tracert (Trace Network Route)β
- Windows:
tracert <hostname_or_IP>
- macOS/Linux:
traceroute <hostname_or_IP>
π Displays the path packets take to reach a destination.
Example:
traceroute google.com
Shows all hops taken to reach Googleβs server.
π NSLookup (Query DNS Records)β
nslookup <hostname_or_IP>
π Fetches domain name system (DNS) records for a given hostname or IP.
Example:
nslookup google.com
Returns the IP address of Google's domain.
π‘ Dig (Get Detailed DNS Information)β
- Query DNS records:
dig <hostname>
- Perform reverse lookup:
dig -x <IP_address>
π Fetches detailed DNS records or performs a reverse lookup.
Example:
dig google.com
Displays detailed DNS information for Googleβs domain.
π§ Telnet (Test Port Connectivity)β
telnet <hostname_or_IP> <port>
π Tests connectivity to a specific port on a remote host.
Example:
telnet google.com 80
Checks if Google's web server is accessible on port 80.
π Curl (Retrieve Data from URLs)β
curl <url>
π Fetches web content, tests API responses, or checks server availability.
Example:
curl -I https://google.com
Returns the HTTP headers of Googleβs homepage.
π₯ Wget (Download Files from the Web)β
wget <url>
π Downloads files via HTTP, HTTPS, or FTP.
Example:
wget https://example.com/file.zip
Downloads a file from the given URL.
π¦ MTR (Network Diagnostic Tool)β
mtr <hostname_or_IP>
π Combines ping and traceroute for real-time network monitoring.
Example:
mtr google.com
Continuously monitors the route to Googleβs server.
π Nmap (Network Scanner)β
nmap <hostname_or_IP>
π Scans networks to discover hosts and open ports.
Example:
nmap -p 80,443 google.com
Scans Googleβs server for open web ports.
π SCP (Secure Copy Protocol)β
scp <file> <user>@<remote_host>:<destination_path>
π Securely transfers files between local and remote systems over SSH.
Example:
scp myfile.txt user@192.168.1.10:/home/user/
_ Copies myfile.txt
to a remote server. _