Create DNS Record
create_dns_recordAdds a DNS record to a domain in the authenticated Porkbun account and returns its ID for later updates or deletion. Use it for A, AAAA, CNAME, MX, TXT, and other supported record types.
Instructions
Create a DNS record on a domain in the authenticated account. Returns the new record's id as a string, the same form list_dns_records and existingId use, so it can be passed straight to update_dns_record and delete_dns_record. For the name field: omit or pass empty string for the apex/root, otherwise pass the subdomain prefix only (e.g. www, not www.example.com). For MX and SRV records, set prio (priority). SMIMEA takes TLSA-style content -- usage selector matching_type certificate-hex -- at <hash>._smimecert.<domain>. OPENPGPKEY takes a base64 OpenPGP public key at <hash>._openpgpkey.<domain>, max 2500 characters; export a minimal key (gpg --export --export-options export-minimal), because a full key with photo IDs will not fit. Both are only meaningful in a DNSSEC-signed zone. DS here is for delegating a SUBDOMAIN to someone else's signed nameservers (name must be that subdomain, content keytag algorithm digesttype digest) -- a DS at the apex is refused, because the chain of trust for the domain itself lives at the registry: use create_dnssec_record for that. Free, doesn't spend account credit. If a record with this exact name, type and content already exists the call fails with DUPLICATE_RECORD and returns that record's id in existingId — use it rather than retrying or creating a variant. If a CNAME would share a name with another record type (forbidden by RFC 1034) the call fails with RECORD_CONFLICT and lists the blocking rows in conflictingRecords; delete those or pick another name.
Check warnings in the response and pass it on. Porkbun keeps a DNS zone for every domain in the account whether or not the domain is delegated to Porkbun's nameservers, so this write succeeds either way. If the domain points somewhere else, the response is still SUCCESS but carries a warnings string naming the nameservers that actually answer — the record exists and nothing resolves differently. Do not report plain success in that case: either make the change at the provider that runs those nameservers, or offer update_nameservers to point the domain at Porkbun.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"domain": "<domain>",
"type": "<type>",
"content": "<content>"
},
"name": "create_dns_record"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ttl | No | Time-to-live in seconds. Minimum 60. Defaults to 600 if omitted. | |
| name | No | Subdomain prefix (no domain). Empty string or omitted = apex. Examples: `www`, `mail`, `api.staging`. | |
| prio | No | Priority — required for MX and SRV records, ignored otherwise. | |
| type | Yes | Record type. Common: A, AAAA, CNAME, MX, TXT. | |
| domain | Yes | Domain to add the record to, e.g. `example.com` | |
| content | Yes | Record value (e.g. an IP for A, a hostname for CNAME, the text body for TXT). | |
| dry_run | No | If true, validate only — returns wouldSucceed without creating the record. |