The DNS Records resource provides methods to manage DNS records for zones, including creating, updating, listing, and deleting records.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cloudflare/cloudflare-typescript/llms.txt
Use this file to discover all available pages before exploring further.
Main methods
create
Create a new DNS record for a zone.Zone identifier
DNS record type (e.g., ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘TXT’, ‘SRV’, etc.)
DNS record name (e.g., ‘example.com’ or ‘subdomain.example.com’)
DNS record content (varies by record type)
Time to live, in seconds. Use 1 for automatic (defaults to auto)
Whether the record is receiving Cloudflare’s performance and security benefits (only applicable to A, AAAA, and CNAME records)
Record priority (required for MX and SRV records)
DNS record identifier
Record type
DNS record name
DNS record content
Whether the record is proxied through Cloudflare
Time to live in seconds
Whether the record is locked from editing
When the record was created
When the record was last modified
update
Overwrite an existing DNS record.DNS record identifier (first parameter)
Zone identifier
DNS record type
DNS record name
DNS record content
Time to live in seconds
list
List, search, sort, and filter a zone’s DNS records.Zone identifier
Filter by DNS record type
Filter by DNS record name
Filter by DNS record content
Filter by proxy status
Field to order records by
Direction to order records
delete
Delete a DNS record.DNS record identifier (first parameter)
Zone identifier
get
Get DNS record details.DNS record identifier (first parameter)
Zone identifier
Additional methods
edit
Update an existing DNS record (partial update).batch
Send a batch of DNS record API calls to be executed together.import
Import DNS records from a BIND config file.export
Export DNS records in BIND config format.Record types
Common DNS record types include:- A - Maps a domain to an IPv4 address
- AAAA - Maps a domain to an IPv6 address
- CNAME - Creates an alias for another domain
- MX - Specifies mail servers for the domain
- TXT - Stores text information
- SRV - Defines service locations
- NS - Delegates a subdomain to different nameservers
- CAA - Specifies which certificate authorities can issue certificates
- PTR - Reverse DNS lookup
- HTTPS - HTTPS service binding
- SVCB - Service binding
Important notes
- A/AAAA records cannot exist on the same name as CNAME records
- NS records cannot exist on the same name as any other record type
- Domain names are always represented in Punycode, even if Unicode characters were used
- Use
ttl: 1for automatic TTL (Cloudflare manages it) - Only A, AAAA, and CNAME records support the
proxiedoption