Networking
Ports
shell
# Find the programs that are listening on ports
netstat -plnt
ss -plnt
lsof -i -P | grep <port>
Internet/DNS
shell
# Show domain IP address
dig +short [Link]
nslookup [Link]
# Check DNS using specific nameserver
# [Link] = google, [Link] = cloudflare, [Link] = opendns
dig @[Link] [Link]
nslookup [Link] [Link]
# Find host provider
whois <ip_address> | grep -i "orgname\|netname"
# Curl headers with redirect
curl --head --location "[Link]
# Test if a host is reachable on the network. `ping6` works on IPv6
networks.
ping [Link]
# Show the route taken to a host. `traceroute6` works on IPv6 networks.
traceroute [Link]
mtr [Link]
# List details of network interfaces
ip address
# Check local DNS settings
cat /etc/hosts
cat /etc/[Link]
systemd-resolve --status
# Capture traffic to/from a host
sudo tcpdump host [Link]