Create DNS Record
Create a new DNS record for a zone.
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 when creating the record.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
DNS WriteBody ParametersJSONExpand Collapse
body: ARecord { name, ttl, type, 6 more } or AAAARecord { name, ttl, type, 6 more } or CNAMERecord { name, ttl, type, 5 more } or 18 more
ARecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
AAAARecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
CNAMERecord = object { name, ttl, type, 5 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { flatten_cname, ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record itself. This setting is unavailable for proxied records, since they are always flattened.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
MXRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
NSRecord = object { name, ttl, type, 5 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
DNSRecordsOpenpgpkeyRecord = object { name, ttl, type, 5 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
PTRRecord = object { name, ttl, type, 5 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
TXTRecord = object { name, ttl, type, 5 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Text content for the record. The content must consist of quoted "character strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding this allowed maximum length are automatically split.
Learn more at https://www.cloudflare.com/learning/dns/dns-records/dns-txt-record/.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
CAARecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
CERTRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
DNSKEYRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
DSRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
HTTPSRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
LOCRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
NAPTRRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
SMIMEARecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
data: optional object { certificate, matching_type, selector, usage } Components of a SMIMEA record.
Components of a SMIMEA record.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
SRVRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Priority, weight, port, and SRV target. See 'data' for setting the individual component values.
data: optional object { port, priority, target, weight } Components of a SRV record.
Components of a SRV record.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
SSHFPRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
SVCBRecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
TLSARecord = object { name, ttl, type, 6 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
URIRecord = object { name, ttl, type, 7 more }
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Comments or notes about the DNS record. This field has no effect on DNS responses.
Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred.
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: optional object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
ReturnsExpand Collapse
Openpgpkey = object { id, comment, content, 12 more }
Whether the record is receiving the performance and security benefits of Cloudflare.
settings: object { ipv4_only, ipv6_only } Settings for the DNS record.
Settings for the DNS record.
When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
Create DNS Record
curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"name": "example.com",
"ttl": 3600,
"type": "A",
"comment": "Domain verification record",
"content": "198.51.100.4",
"private_routing": true,
"proxied": true
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"name": "example.com",
"ttl": 3600,
"type": "A",
"comment": "Domain verification record",
"content": "198.51.100.4",
"private_routing": true,
"proxied": true,
"settings": {
"ipv4_only": true,
"ipv6_only": true
},
"tags": [
"owner:dns-team"
],
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"created_on": "2014-01-01T05:20:00.12345Z",
"meta": {},
"modified_on": "2014-01-01T05:20:00.12345Z",
"proxiable": true,
"comment_modified_on": "2024-01-01T05:20:00.12345Z",
"tags_modified_on": "2025-01-01T05:20:00.12345Z"
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"name": "example.com",
"ttl": 3600,
"type": "A",
"comment": "Domain verification record",
"content": "198.51.100.4",
"private_routing": true,
"proxied": true,
"settings": {
"ipv4_only": true,
"ipv6_only": true
},
"tags": [
"owner:dns-team"
],
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"created_on": "2014-01-01T05:20:00.12345Z",
"meta": {},
"modified_on": "2014-01-01T05:20:00.12345Z",
"proxiable": true,
"comment_modified_on": "2024-01-01T05:20:00.12345Z",
"tags_modified_on": "2025-01-01T05:20:00.12345Z"
}
}