set_dns
Configure DNS records for domains through Dynadot's service. Manage main records and subdomains with API parameters for A, AAAA, CNAME, MX, TXT, and other record types.
Instructions
Set DNS records for a domain using Dynadot's DNS service. Supports main records and up to 10 subdomains. Use the records parameter to pass Dynadot API parameters like main_record_type, main_record, subdomain0, sub_record_type0, sub_record0, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to set DNS for | |
| records | Yes | DNS record parameters as key-value pairs. Keys follow Dynadot API3 set_dns2 naming: main_record_type0..19 (a/aaaa/cname/forward/txt/mx/stealth/email), main_record0..19 (value), main_recordx0..19 (MX distance/forward type/stealth title/email alias), subdomain0..9 (name), sub_record_type0..9 (type), sub_record0..9 (value), sub_recordx0..9 (MX distance etc), ttl (optional, default 300), add_dns_to_current_setting (optional, set to '1' to append instead of overwrite) |
Implementation Reference
- src/services/dynadot-client.ts:202-204 (handler)The implementation of the setDns service method that calls the underlying Dynadot API "set_dns2" command.
async setDns(domain: string, records: Record<string, string>): Promise<DynadotResponse> { return this.call("set_dns2", { domain, ...records }); } - src/tools/dns.ts:53-90 (handler)The MCP tool registration and handler implementation for "set_dns".
server.tool( "set_dns", "Set DNS records for a domain using Dynadot's DNS service. Supports " + "main records and up to 10 subdomains. Use the records parameter " + "to pass Dynadot API parameters like main_record_type, main_record, " + "subdomain0, sub_record_type0, sub_record0, etc.", { domain: z.string().describe("Domain name to set DNS for"), records: z .record(z.string()) .describe( "DNS record parameters as key-value pairs. Keys follow Dynadot API3 set_dns2 naming: " + "main_record_type0..19 (a/aaaa/cname/forward/txt/mx/stealth/email), " + "main_record0..19 (value), main_recordx0..19 (MX distance/forward type/stealth title/email alias), " + "subdomain0..9 (name), sub_record_type0..9 (type), sub_record0..9 (value), " + "sub_recordx0..9 (MX distance etc), ttl (optional, default 300), " + "add_dns_to_current_setting (optional, set to '1' to append instead of overwrite)" ), }, async ({ domain, records }) => { try { const result = await client.setDns(domain, records); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: `Failed to set DNS records: ${msg}` }, ], isError: true, }; } } );