| name | network-diagnostics |
| description | Agents should invoke this skill for connectivity, DNS, Pi-hole, port reachability, routing, firewall reachability, TLS/network timeouts, or service access failures. Provides structured network troubleshooting commands and interpretation. |
Network Diagnostics
Diagnose and troubleshoot network issues including connectivity, DNS, ports, and routing.
Quick Start
Connectivity Check
ping -c 3 1.1.1.1
dig google.com +short
curl -s -o /dev/null -w "%{http_code}" http://pi.hole/admin/
DNS Diagnostics
Basic DNS Resolution
dig example.com +short
dig @1.1.1.1 example.com +short
dig @8.8.8.8 example.com +short
dig @pi.hole example.com +short
dig -x <ip-address> +short
dig example.com +trace
Pi-hole DNS Analysis
dig @pi.hole ads.google.com +short
curl -s "http://pi.hole/admin/api.php?getAllQueries=100" | jq '.data | length'
curl -s "http://pi.hole/admin/api.php?getForwardDestinations" | jq '.'
curl -s "http://pi.hole/admin/api.php?status" | jq '.status'
DNS Troubleshooting Flow
DNS not resolving?
├── Can you ping 1.1.1.1?
│ ├── No → Network/routing issue (not DNS)
│ └── Yes → DNS issue confirmed
│ ├── Does dig @1.1.1.1 work?
│ │ ├── No → Upstream DNS blocked (firewall?)
│ │ └── Yes → Local DNS problem
│ │ ├── Does dig @pi.hole work?
│ │ │ ├── No → Pi-hole issue
│ │ │ │ ├── Is pihole-FTL running?
│ │ │ │ ├── Is port 53 listening?
│ │ │ │ └── Check Pi-hole logs
│ │ │ └── Yes → Client DNS config issue
│ │ │ └── Check /etc/resolv.conf
│ │ └── Is /etc/resolv.conf pointing to Pi-hole?
Connectivity Testing
Layer-by-Layer Diagnosis
ip link show
ethtool <interface>
ip addr show
ip route show
ping -c 3 <gateway>
ping -c 3 1.1.1.1
ss -tlnp
ss -ulnp
curl -v http://example.com
Traceroute
traceroute <host>
traceroute -T -p 443 <host>
mtr --report <host>
Port Reachability
Check if a Port is Open
nc -zv <host> <port>
timeout 3 bash -c "echo > /dev/tcp/<host>/<port>" && echo "open" || echo "closed"
for port in 22 53 80 443 3000 8080 11434; do
nc -zv <host> $port 2>&1 | grep -E "succeeded|refused"
done
Port Scan (Local Network)
nmap -F <host>
nmap -p 22,53,80,443,3000,8080,11434 <host>
nmap -sn <local-subnet-cidr>
Known Service Ports
| Host | Port | Service | Protocol |
|---|
| pi.hole | 53 | DNS | UDP/TCP |
| pi.hole | 80 | Web UI | HTTP |
| 3000 | Gitea | HTTP |
| | NAS SSH | SSH |
| 22 | SSH server | SSH |
| 11434 | Ollama | HTTP |
Network Topology
Local Network Map
Internet
│
▼
[Router/Gateway]
│
├── Pi-hole (DNS) ─── pi.hole:53, :80
│
├── <gitea-or-nas-host> ─── Gitea :3000, NAS SSH :<ssh-port>
│
├── <ssh-host> ─── SSH server :22
│
├── <ollama-host> ─── Ollama :11434
│
└── [This machine] ── Workstation
Discover Network Devices
ip neigh show
nmap -sn <local-subnet-cidr>
Troubleshooting Workflows
"Service X is Unreachable"
- Ping the host:
ping -c 3 <host> — Is the machine up?
- Check the port:
nc -zv <host> <port> — Is the service listening?
- Check locally: SSH in, run
ss -tlnp | grep <port> — Is it bound?
- Check firewall: Is the port allowed through?
- Check the service:
systemctl status <service> — Is it running?
- Check logs:
journalctl -u <service> -n 20 — Any errors?
"Internet is Slow"
- Check DNS:
time dig google.com — Slow DNS resolution?
- Check latency:
ping -c 10 1.1.1.1 — High latency?
- Check bandwidth:
curl -o /dev/null -w "%{speed_download}" https://speed.cloudflare.com/__down?bytes=10000000
- Check for packet loss:
mtr --report -c 20 1.1.1.1
- Check local network:
iperf3 -c <local-host> — LAN speed OK?
"Pi-hole Stopped Blocking Ads"
- Check status:
curl -s "http://pi.hole/admin/api.php?status" | jq '.status'
- Check if disabled: Someone might have paused it
- Check blocklists:
curl -s "http://pi.hole/admin/api.php?summary" | jq '.gravity_last_updated'
- Update gravity:
pihole -g (requires SSH to Pi-hole host)
- Check client DNS: Is the client actually using Pi-hole?
cat /etc/resolv.conf
Useful One-Liners
curl -s ifconfig.me
ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v 127.0.0.1
dig @pi.hole <domain> +short
time dig google.com @pi.hole > /dev/null
ip -br link show
Kai skill — Network diagnostics and troubleshooting