Help

DNS Management with MCP: AI Tools for DNS Records and Name Servers

Phase 2 of the 101domain API introduces four new MCP tools that allow your AI agent or automation platform to create, edit, and delete DNS records, and update name servers for domains in your account - all through natural language prompts.

Required scope: All four tools require the dns_write scope on your API key. MCP tools are not discoverable by your AI client if the required scope is not enabled on the key you connect with. A dns_read key is sufficient only for the existing get-domain-dns-tool.

If your existing API key does not have dns_write enabled, you will need to generate a new API key with that scope — scopes cannot be added to an existing key after creation. See API Key Scopes and Permissions for the full scope reference.

DNS management via MCP is available only for domains using 101domain managed name servers or Secure Web Accelerator (SWA) name servers.

Security note: These tools perform write operations on live DNS data. Before connecting an AI agent with dns_write scope, review Essential Security Practices for MCP Clients and How Can I Stop My AI Agent from Making Unintended Changes to Domains or DNS? A misconfigured DNS record or name server change can affect email delivery, website availability, and other critical services.

edit-name servers-tool

Replaces the name servers for a domain. The AI will ask for the domain name and the full list of new name servers.

Example prompts:

  • "Set the name servers for example.com to ns1.newhost.com and ns2.newhost.com."

  • "Update the name servers on mybrand.net — use ns1.cloudflare.com and ns2.cloudflare.com."

What the tool returns: The domain name, whether the change is completed (applied immediately) or pending (submitted and processing), the requested name servers, and the current active name servers.

Things to know:

  • At least 2 and no more than 13 name servers are required.

  • Glue records are not supported. Contact support if your name servers require them.

  • Some domains require a paid name server-change product. These must be handled through the control panel.

  • Domains with DNSSEC or Secure Web Accelerator (SWA) active cannot have name servers changed via the API. Contact our support team for help.

  • Name server changes are rate-limited per domain. The tool will report the error clearly if the limit is reached

add-domain-dns-records-tool

Creates one or more DNS records for a domain. You can add a single record or describe multiple records in one prompt. tthe tool submits up to 25 records per request.

Example prompts:

  • "Add an A record for www on example.com pointing to 192.0.2.1."

  • "Add a Google Workspace MX record to mybrand.com."

  • "Add a TXT record to example.com for SPF: 'v=spf1 include:_spf.google.com ~all'."

  • "Add an MX record, a TXT record for SPF, and a CNAME for mail to example.com."

Supported record types: A, AAAA, CNAME, NS (subdomain delegations only), MX, TXT, SRV, CAA.

Apex NS records: name server records for the domain root (apex NS) are not managed through this tool — they do not appear in the DNS record list at all, and the tool cannot create them. To change a domain's name servers, use edit-name servers-tool instead. Subdomain NS delegations are fully supported.

Things to know:

  • The tool is idempotent. Submitting a record that already exists will not create a duplicate.

  • The tool will report a clear error if the domain is not using 101domain managed or SWA name servers.

edit-domain-dns-records-tool

Edits existing DNS records. You describe which record to change and what to update. You do not need to look up or supply a record ID yourself, the tool identifies the record for you.

Example prompts:

  • "Change the TTL of the www A record on example.com to 7200."

  • "Update the A record for mail on example.com to point to 203.0.113.50."

  • "Change the MX priority for example.com from 10 to 20."

Things to know:

  • You cannot change a record's name or type. To do that, remove the record and add a new one.

  • The edit is atomic across a batch. If any record in the request cannot be found, no records are changed.

  • For best results when editing multiple records, describe each change clearly: "Change the TTL of the www A record to 3600 and update the mail A record to point to 203.0.113.10.".

remove-domain-dns-records-tool

Deletes one or more DNS records from a domain. You describe which records to remove. You do not need to supply record IDs, the tool identifies and deletes the specified records for you.

Example prompts:

  • "Delete the www A record from example.com."

  • "Remove the old CNAME for webmail on mybrand.net."

  • "Delete the TXT record containing 'v=spf1 -all' from example.com."

Things to know:

  • Deletion is atomic. If any record cannot be found, no records in the batch are deleted

  • Apex NS and SOA records do not appear in the DNS record list and cannot be deleted through this tool.

  • Once deleted, a record cannot be recovered. Confirm with the AI before proceeding if you have any uncertainty.

  • Be specific in your prompt to avoid unintended removals

AI agent design recommendations

Because DNS changes can directly affect live services, we strongly recommend the following when building agents that use these tools. See How Can I Stop My AI Agent from Making Unintended Changes to Domains or DNS? for detailed guidance.

Always confirm before writing. Add explicit instructions to your AI agent's system prompt requiring it to present the planned change and ask for confirmation before executing any DNS create, edit, or delete operation.

Example instruction: "Before adding, editing, or deleting any DNS record or name server, always show the user exactly what you are about to do and ask for explicit confirmation."

Use the minimum required scope. If your agent only needs to read DNS data, issue it a key with dns_read only. Reserve dns_write keys for agents that explicitly need to make changes. See API Key Scopes and Permissions.

Keep separate keys for separate functions. A key used by a DevOps pipeline to manage DNS should be separate from one used by a general-purpose chatbot. This limits exposure if a key is ever compromised. See Security Best Practices for MCP Connections for full guidance.

For troubleshooting, see Why Was My name server Change Rejected? and Why Can't I Edit or Delete a DNS Record?

If you have any questions, contact our Support Team at 877.983.6624 (US) or +1.760.444.8674 (International).