Every networking command worth knowing from a terminal, with what it actually shows you.
Find your public IP address
$ curl ifconfig.me -s
# returns your machine's public-facing IP addressPing — round-trip time & packet loss
$ ping google.com
PING google.com (142.250.77.238): 56 data bytes
64 bytes from 142.250.77.238: icmp_seq=0 ttl=118 time=8.518 ms
64 bytes from 142.250.77.238: icmp_seq=1 ttl=118 time=9.610 ms
...
--- google.com ping statistics ---
11 packets transmitted, 11 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 7.685/9.245/11.478/1.016 msDNS lookup
$ dig google.com # full DNS resolution trace
$ man dig # manual / all available flags
$ dig -type=mx gmail.com # find a domain's mail servers (MX records)Packet capture
$ tcpdump -c 5
# captures the next 5 packets crossing a network interface, liveQuick reference table
| Command | Purpose |
|---|---|
curl ifconfig.me -s | Show public IP address |
ping <host> | Test reachability + measure RTT |
dig <domain> | DNS lookup / resolution trace |
tcpdump -c N | Capture N live packets |