Network cheatsheets
Common operational commands. Review commands before running them in production; examples use example.com and documentation addresses.
Linux networking
| Task | Command |
|---|---|
| Show addresses | ip addr show |
| Show routes | ip route show |
| Show listening ports | ss -tulpn |
| DNS query | dig example.com A +short |
| Reverse DNS | dig -x 1.1.1.1 +short |
| HTTP response headers | curl -I https://example.com |
| TLS certificate | openssl s_client -connect example.com:443 -servername example.com |
| Trace route | traceroute -n example.com |
| Packet capture | sudo tcpdump -ni any host 1.1.1.1 |
DNS
| Task | Command |
|---|---|
| A / AAAA | dig example.com A +short\ndig example.com AAAA +short |
| MX | dig example.com MX +short |
| TXT / SPF | dig example.com TXT +short |
| DMARC | dig _dmarc.example.com TXT +short |
| DKIM | dig selector._domainkey.example.com TXT +short |
| Trace delegation | dig +trace example.com |
Cisco IOS
| Task | Command |
|---|---|
| Interfaces | show ip interface brief |
| Routes | show ip route |
| ARP table | show ip arp |
| MAC table | show mac address-table |
| Running config | show running-config |
| Save config | copy running-config startup-config |
| Ping with source | ping\nProtocol [ip]:\nTarget IP address: 1.1.1.1\nExtended commands [n]: y |
MikroTik RouterOS
| Task | Command |
|---|---|
| Interfaces | /interface print |
| IP addresses | /ip address print |
| Routes | /ip route print detail |
| Firewall rules | /ip firewall filter print |
| Connections | /ip firewall connection print |
| DNS cache | /ip dns cache print |
| Export configuration | /export hide-sensitive file=backup |
HTTP / security
| Task | Command |
|---|---|
| Fetch headers | curl -sI https://example.com |
| Test CSP | curl -sI https://example.com | grep -i content-security-policy |
| Follow redirects | curl -sIL https://example.com |
| HTTP/2 verbose | curl -Iv --http2 https://example.com |
| Check TLS protocols | openssl s_client -connect example.com:443 -tls1_2 |