Manage DNS Records and Nameservers via API or AI Agents with MCP

Managing DNS programmatically has long required manual workarounds: exporting records from a control panel, making changes by hand, tracking edits in spreadsheets, and hoping nothing drifts out of sync. For teams that manage dozens, hundreds, or thousands of domains, that workflow causes friction — deployment delays, misconfigured records, and no reliable audit trail that travels with each change.

Starting today, clients can create, edit, and delete DNS records — and replace nameservers — directly through the 101domain API and MCP Server tools, without needing to log into the control panel.


What our new DNS and nameserver endpoints cover

We’ve added four API endpoints that cover the complete record-management lifecycle, enabling atomic, programmatic control over domain DNS and nameserver settings.

POST /v1/dns/{domain_name}/records

Create up to 25 DNS records per request. Supported types include A, AAAA, CNAME, NS (for subdomain delegations), MX, TXT, SRV, and CAA. This endpoint is ideal for provisioning new services or bootstrapping zone changes as part of automated deployments.

PATCH /v1/dns/{domain_name}/records

Edit existing records by record ID. The PATCH call applies only the fields you include, so you can update TTLs, content, or other attributes without replacing the entire record entry.

DELETE /v1/dns/{domain_name}/records

Delete up to 25 records in a single atomic request. The operation is all-or-nothing: if any provided record ID is not found, no records are removed. This prevents partial deletions and maintains zone consistency.

PUT /v1/dns/{domain_name}/nameservers

Replace nameservers for a domain. The endpoint accepts 2–13 hostnames and returns status codes to indicate whether the configuration was already current (200) or is pending registry processing (202).

All four endpoints require the dns_write scope on your API key. Scopes are set at key creation and cannot be added later, so if your current key lacks dns_write you’ll need to generate a new key in Developer Settings before calling these endpoints.


Why this feature matters for teams running automated pipelines

A common bottleneck for teams operating at scale is that DNS changes still require a human to sign in to a portal. Deployment scripts can provision infrastructure, update load balancers, and release application builds, but adding an A record or creating a TXT record for verification interrupts automation.

These new endpoints close that gap. Provisioning scripts, CI/CD pipelines, and internal tooling can now manage DNS changes end-to-end without a context switch to a browser. When combined with existing read endpoints — which return full zone data including nameserver assignments — you can build reliable, auditable DNS automation flows that integrate directly with your deployment processes.


The same capabilities are available for AI agents with our MCP Server

We’ve also added four MCP Server tools that mirror these endpoints for teams that use AI agents with 101domain. These tools let agents perform DNS changes using plain-language instructions while handling record lookup and ID resolution behind the scenes.

add-domain-dns-records-tool

Creates records from a natural-language description of the desired change, reducing the need for users to construct raw DNS payloads.

edit-domain-dns-records-tool

Modifies existing records without requiring you to look up record IDs — the tool resolves the correct records internally.

remove-domain-dns-records-tool

Removes records by description; the tool performs ID lookup and ensures the correct entries are deleted.

edit-nameservers-tool

Replaces nameservers using conversational instructions and reports whether the change applied immediately or is pending registry processing.

In practical terms, an AI agent connected to the MCP Server can carry out a DNS change from a plain-language instruction — for example, “add a TXT record for Google Workspace verification to example.com” — without a user needing to know record formats or lookup IDs. The tool-side ID resolution removes the main friction point that typically prevents AI-assisted DNS workflows.


A few things worth knowing before you start

DNS write access via API and MCP applies only to domains using 101domain-managed nameservers or to domains using Secure Web Accelerator (SWA) powered by Cloudflare DNS nameservers. If a domain is delegated to third-party nameservers, the API cannot read or modify its zone data.

Recommended key scope for DNS-only agents: If you are creating an API key specifically for DNS automation, grant only the dns_read and dns_write scopes. That pair is the minimum footprint required for read and write DNS operations. Remember that scopes cannot be added to a key after creation, so plan key generation accordingly.

Full technical documentation, including request and response examples, status code references, and scope requirements, is available in our DNS Write Endpoints guide and the API documentation. MCP tool descriptions and connection setup are described in the MCP Server Tools reference.

Ready to add DNS write access to your integration?

Generate a new API key with the dns_write scope in Developer Settings, then follow the DNS Write Endpoints guide to start managing records programmatically and integrating DNS changes into your automated workflows.

View the DNS Write Endpoints guide