Networking Cheat Sheet
A short operational cheat sheet for network troubleshooting on Linux.
Interfaces and Addressing
Routes
Sockets and Ports
Reachability Checks
ping -c 4 1.1.1.1
ping -c 4 google.com
traceroute 8.8.8.8
mtr 8.8.8.8
curl -I https://example.com
nc -vz host 443
telnet host 25
DNS
dig example.com
dig A example.com +short
dig MX example.com +short
dig @1.1.1.1 example.com
dig +trace example.com
host example.com
nslookup example.com
resolvectl status
Packet Capture
tcpdump -i eth0
tcpdump -i eth0 port 53
tcpdump -i any host 10.0.0.10
tcpdump -nn -i eth0 tcp port 443
Firewall
Debug One-Liners
curl -vk https://example.com
openssl s_client -connect example.com:443 -servername example.com
ip neigh
arp -an
ethtool eth0