| name | dns-diagnose |
| version | 1.0.0 |
| description | Local DNS resolution troubleshooting with dig/resolvectl/whois. Investigate NXDOMAIN, wrong answers, records not taking effect, and resolver failures. Read-only; do not change DNS config. Also matches Chinese requests such as DNS 解析失败、域名解析不了、NXDOMAIN、解析不到.
|
| author | aish |
| context | subagent |
| agent | troubleshoot |
| allowed-tools | ["bash","read_file","grep","glob"] |
| triggers | ["dns-diagnose","DNS diagnosis","DNS resolution failed","NXDOMAIN","cannot resolve domain","DNS not working","domain resolve","DNS 诊断","DNS 解析失败","域名解析不了","解析不到"] |
| platforms | ["linux"] |
| distributions | ["deepin","debian","ubuntu","uos"] |
DNS resolution diagnosis
Troubleshoot domain resolution failures, wrong answers, or “I changed the record but it still fails” on this host.
Out of scope: editing /etc/resolv.conf or NetworkManager by default, buying domains / changing authoritative DNS for the user, HTTP 5xx, or TLS certificate issues (ssl-cert-toolkit). Path quality after resolve succeeds belongs to network-path-diagnose.
Rules
- Need a domain first: ask if missing; optional expected type (A/AAAA/CNAME/MX/TXT).
- Read-only: inspect resolution and config; do not change DNS servers or hosts unless the user explicitly asks (default is advice only).
- Stop when enough: once you can separate “local resolver” vs “authoritative/record” issues, answer.
- Missing tools: prefer
dig; else host / nslookup / getent.
- Ask before sending internal/sensitive names to public DNS,
+trace, or whois.
Workflow
Confirm domain & symptom → local resolver → local dig → optional external checks → answer
1. Confirm inputs
| Input | Notes |
|---|
| Domain | e.g. example.com or www.example.com |
| Symptom | total failure / wrong answer / recent change not visible / only on some networks |
| Record type | default A/AAAA; include MX if mail-related |
2. Local resolver
cat /etc/resolv.conf 2>/dev/null
resolvectl status 2>/dev/null || systemd-resolve --status 2>/dev/null || true
getent ahosts <domain> | head -10
grep '^hosts:' /etc/nsswitch.conf 2>/dev/null
grep -E "^\s*[0-9a-fA-F:.]+\s+.*\b<domain>\b" /etc/hosts 2>/dev/null || true