dns
Diagnose DNS problems or configure DNS records for a domain
Route the DNS request to the right backend: the dns-diagnostic agent for troubleshooting, or direct dns MCP tool calls for first-time setup.
Process
-
Read
$ARGUMENTS. Identify the domain and the intent. -
Determine mode by keyword content:
- Diagnostic mode — argument includes problem words: "not loading", "broken", "error", "bouncing", "diagnose", "why", "what's wrong", "down".
- Setup mode — argument includes setup words: "set up", "setup", "configure", "add records".
- Bare domain or anything else — use AskUserQuestion with two options:
diagnose-problem,configure-records. Do NOT default a bare domain to setup mode — a user typing/domain-agent-kit:dns example.comis more likely to be reporting a problem than asking for fresh configuration.
Diagnostic mode
-
Invoke the
dns-diagnosticagent via the Task tool with: the domain, the exact symptom the user described, and any context from surrounding messages. -
Present the agent's report verbatim. The report includes a proposed fix as a concrete
dnstool call. -
If the user approves the fix, execute the exact tool call the agent proposed — do not modify parameters. If the user wants changes, re-invoke the agent with the adjustments.
Setup mode
-
Fetch current records via
dnswithoperation: getfor the domain. This is mandatory — never write without reading first. -
Present the current state, then ask via AskUserQuestion what the user wants to configure:
website— A / AAAA records pointing at a hostemail— MX + SPF + DMARC (optionally DKIM)verification— TXT records for domain ownership proofsubdomain— CNAME for a subdomainredirect— URL forwarding (handled viadomain_settings, notdns)
-
For each record type, collect specific values (IP address, mail server, TXT content, etc.) via AskUserQuestion with free-text entry.
-
Compute the merged record set:
- Merge rule: new records of a given (type, host) tuple replace any existing records for that tuple. Records of other (type, host) tuples are preserved verbatim. The
dnstool'ssetoperation rewrites the entire record set for a domain in one call, so you must include both the new records AND the preserved existing ones in your call. - Display the diff to the user before calling
set: which records will be added, which replaced, which preserved unchanged.
- Merge rule: new records of a given (type, host) tuple replace any existing records for that tuple. Records of other (type, host) tuples are preserved verbatim. The
-
Apply via
dnswithoperation: set, passing the full merged record set. -
Re-fetch records via
dnswithoperation: getafter applying and present the confirmed new state.
Do not
- Do not diagnose DNS problems inline by running
digandcurlyourself in this command. The dns-diagnostic agent runs in an isolated context and produces a cleaner report. - Do not propose any DNS change without fetching the current state first. Overwriting without merge is the number-one source of DNS outages.
- Do not combine diagnose and setup into one workflow. They have different risk profiles — diagnostic reads only, setup writes — and conflating them leads to accidental overwrites during troubleshooting.
- Do not use this command for bulk DNS audits across many domains — use
/domain-agent-kit:auditinstead. - Do not use this command to choose a new domain — use
/domain-agent-kit:brainstorminstead.
Success criteria
- Diagnostic mode: user receives a root-cause report with a specific fix and, if approved, the fix is applied and re-verified.
- Setup mode: requested DNS records are live at Dynadot, existing records are preserved, and the final state is fetched and shown.