Vigiar
1
0
Derivar
Você já tinha feito uma derivação do repositório claude-plugin, anteriormente
0
claude-plugin/skills/manage-dns/SKILL.md
2026-11-28 15:28:07 +02:00

6,3 KiB


name: manage-dns description: Read and change the DNS zone of a domain hosted at MozOut: list, add, change and delete A, AAAA, CNAME, MX, TXT, NS, SRV and CAA records, check a record before saving it and restore a zone backup. Use when the user wants to point a domain or subdomain somewhere, add a verification TXT record, set up email records or undo a DNS change.

MozOut DNS

Use this skill for the records inside the zone of a domain that uses our nameservers. To change the nameservers themselves, use manage-domains.

Setup

  • API address: https://api.mozout.com/v1. It is fixed for MozOut: never ask the user for another address.
  • API key: always read it from the MOZOUT_API_KEY environment variable. Check it without printing it: test -n "$MOZOUT_API_KEY" && echo set || echo missing
  • If it is missing, ask the user to create a key in the API Center (https://www.my.mozout.com/api-center.php) with dns:read (and dns:write to change), then to run export MOZOUT_API_KEY="sandbox_..." and restart Claude Code (or the editor).
  • sandbox_ keys read the real account but only simulate writes and never charge. prod_ keys change the account and can charge. GET /v1/token gives the mode in data.mode and the permissions in data.permissions. Suggest a sandbox_ key for a first try.
  • Never print, log or commit the key, and never put it in code that runs in a browser or a mobile app. In code, read it from the environment.

Every request looks like this:

curl -sS "https://api.mozout.com/v1/PATH" -H "Authorization: Bearer $MOZOUT_API_KEY" -H "Accept: application/json"

Rules

  • Before anything that charges, deletes data or cannot be undone, tell the user exactly what will happen (with the price, when the API gives one) and wait for a clear yes.
  • Send an Idempotency-Key header on purchases, sends and other POST requests that accept it, and reuse the same value if you retry the same request: IDEM=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid).
  • Lists come in pages: ?page=1&per_page=100, and meta.total_pages says how many there are.
  • Long operations answer 202 with an action_id. Follow them with GET /v1/actions/{action_id} every 10 to 20 seconds until status is done or failed.
  • Answer the user in the language they write in, and show amounts with the currency the API returns.

Read the zone

curl -sS "https://api.mozout.com/v1/domains/mybusiness.com/dns" -H "Authorization: Bearer $MOZOUT_API_KEY"
  • Each record has id, name, type, value, ttl, priority and read_only. Records with read_only: true (like the root NS) cannot be changed here.
  • meta.dns_enabled: false means the domain does not use our nameservers: tell the user to change the records where the DNS is hosted, or to move the nameservers (see manage-domains).

Add a record

Check it first, then save it:

curl -sS -X POST "https://api.mozout.com/v1/domains/mybusiness.com/dns/validate" -H "Authorization: Bearer $MOZOUT_API_KEY" \
  -H "Content-Type: application/json" -d '{"name": "www", "type": "A", "value": "203.0.113.10", "ttl": 3600}'
curl -sS -X POST "https://api.mozout.com/v1/domains/mybusiness.com/dns" -H "Authorization: Bearer $MOZOUT_API_KEY" \
  -H "Content-Type: application/json" -d '{"name": "www", "type": "A", "value": "203.0.113.10", "ttl": 3600}'
  • name is the part before the domain; use @ for the domain itself.
  • type is one of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA. priority is for MX and SRV (and is the flag on CAA).
  • SRV value: weight port target. CAA value: tag value.
  • TXT: quotes around the whole value are removed; quotes or backslashes inside the text are refused.
  • A CNAME cannot share its name with other records (409 cname_conflict).

Change and delete

curl -sS -X PUT "https://api.mozout.com/v1/domains/mybusiness.com/dns/RECORD_ID" -H "Authorization: Bearer $MOZOUT_API_KEY" \
  -H "Content-Type: application/json" -d '{"name": "www", "type": "A", "value": "203.0.113.20", "ttl": 3600}'
curl -sS -X DELETE "https://api.mozout.com/v1/domains/mybusiness.com/dns/RECORD_ID" -H "Authorization: Bearer $MOZOUT_API_KEY"
  • The id changes when the name, type, value or priority changes. Always list again and use the latest id.
  • Before deleting or changing MX, SPF or the record of the website, say what will stop working and ask.
  • 409 with account_email_domain: the account login email is on this domain, so its mail records are changed in My MozOut only.

Backups and reset

  • A copy of the zone is saved before each change (the last 20). GET /v1/domains/{domain}/dns/backups lists them.
  • Undo: POST /v1/domains/{domain}/dns/backups/{id}/restore. If complete is false, list the zone and check.
  • POST /v1/domains/{domain}/dns/reset with {"confirm": "<domain>"} removes all the user's records. Only with an explicit request.

Limits and timing

  • 20 changes and 30 reads per minute per account. Group the work and do not loop.
  • Changes made here show at once in the API. On the internet they take up to the old ttl to spread: tell the user, and check with dig +short www.mybusiness.com A if they want.

Errors

Errors look like {"error": {"code", "message", "correlation_id", "details"}}. Act on code, never on the text of message.

HTTP code What to do
401 unauthorized The key is missing, wrong or revoked. Ask the user to check MOZOUT_API_KEY.
402 insufficient_credit Not enough account credit, and nothing was charged. Give the user details.add_funds_url.
403 insufficient_scope The key lacks a permission. Name it and ask for a key that has it.
403 spending_limit_exceeded The purchase goes over the key spending limit. Nothing was charged.
404 not_found Wrong id, or it is not in this account.
409 conflict and others Read details.reason and explain it in plain words.
422 validation_failed Fix the field named in details and try again.
429 rate_limited Wait for the Retry-After seconds, then try once more.
5xx internal_error, upstream_error Try again later. If the user contacts support, give them the correlation_id.

More