DNS

dns

Domain types

DNSAnalyticsNominalMetric = Array<unknown>
DNSAnalyticsQuery = { dimensions, limit, metrics, 5 more... }
DNS

Analytics

dns.analytics

dns.analytics.reports

Methods

Table -> Envelope<>
get/zones/{zone_id}/dns_analytics/report

Retrieves a list of summarised aggregate metrics over a given time period.

See Analytics API properties for detailed information about the available query parameters.

Domain types

Report = { data, data_lag, max, 4 more... }

dns.analytics.reports.bytimes

Methods

By Time -> Envelope<>
get/zones/{zone_id}/dns_analytics/report/bytime

Retrieves a list of aggregate metrics grouped by time interval.

See Analytics API properties for detailed information about the available query parameters.

Domain types

ByTime = { data, data_lag, max, 5 more... }
DNS

DNSSEC

dns.dnssec

Methods

Delete DNSSEC Records -> Envelope<string>
delete/zones/{zone_id}/dnssec

Delete DNSSEC.

Edit DNSSEC Status -> Envelope<>
patch/zones/{zone_id}/dnssec

Enable or disable DNSSEC.

DNSSEC Details -> Envelope<>
get/zones/{zone_id}/dnssec

Details about DNSSEC status and configuration.

Domain types

DNSSEC = { algorithm, digest, digest_algorithm, 10 more... }
DNS

Records

dns.records

Methods

Batch DNS Records -> Envelope<{ deletes, patches, posts, 1 more... }>
post/zones/{zone_id}/dns_records/batch

Send a Batch of DNS Record API calls to be executed together.

Notes:

  • Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See the documentation for more information.

  • The operations you specify within the /batch request body are always executed in the following order:

    • Deletes
    • Patches
    • Puts
    • Posts
Create DNS Record -> Envelope< | | | 18 more...>
post/zones/{zone_id}/dns_records

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.
Delete DNS Record -> Envelope<{ id }>
delete/zones/{zone_id}/dns_records/{dns_record_id}

Delete DNS Record

Update DNS Record -> Envelope< | | | 18 more...>
patch/zones/{zone_id}/dns_records/{dns_record_id}

Update an existing DNS record.

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.
Export DNS Records -> string
get/zones/{zone_id}/dns_records/export

You can export your BIND config through this endpoint.

See the documentation for more information.

DNS Record Details -> Envelope< | | | 18 more...>
get/zones/{zone_id}/dns_records/{dns_record_id}

DNS Record Details

Import DNS Records -> Envelope<{ recs_added, total_records_parsed }>
post/zones/{zone_id}/dns_records/import

You can upload your BIND config through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present.

See the documentation for more information.

List DNS Records -> V4PagePaginationArray< | | | 18 more...>
get/zones/{zone_id}/dns_records

List, search, sort, and filter a zones' DNS records.

Security
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example: X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example: X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194

Accepted Permissions (at least one required)

DNS Read DNS Write

Parameters
zone_id: string

Identifier

comment: {
Optional
absent: string
Optional

If this parameter is present, only records without a comment are returned.

contains: string
Optional

Substring of the DNS record comment. Comment filters are case-insensitive.

endswith: string
Optional

Suffix of the DNS record comment. Comment filters are case-insensitive.

exact: string
Optional

Exact value of the DNS record comment. Comment filters are case-insensitive.

present: string
Optional

If this parameter is present, only records with a comment are returned.

startswith: string
Optional

Prefix of the DNS record comment. Comment filters are case-insensitive.

}
content: {
Optional
contains: string
Optional

Substring of the DNS record content. Content filters are case-insensitive.

endswith: string
Optional

Suffix of the DNS record content. Content filters are case-insensitive.

exact: string
Optional

Exact value of the DNS record content. Content filters are case-insensitive.

startswith: string
Optional

Prefix of the DNS record content. Content filters are case-insensitive.

}
direction:
Optional

Direction to order DNS records in.

match:
Optional

Whether to match all search requirements or at least one (any). If set to all, acts like a logical AND between filters. If set to any, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the tag-match parameter instead.

"any"
"all"
name: {
Optional
contains: string
Optional

Substring of the DNS record name. Name filters are case-insensitive.

endswith: string
Optional

Suffix of the DNS record name. Name filters are case-insensitive.

exact: string
Optional

Exact value of the DNS record name. Name filters are case-insensitive.

startswith: string
Optional

Prefix of the DNS record name. Name filters are case-insensitive.

}
order:
Optional

Field to order DNS records by.

"type"
"name"
"content"
"ttl"
"proxied"
page: number
Optional

Page number of paginated results.

per_page: number
Optional

Number of DNS records per page.

proxied: boolean
Optional

Whether the record is receiving the performance and security benefits of Cloudflare.

search: string
Optional

Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the match setting. For automated searches, please use the other available parameters.

tag: {
Optional
absent: string
Optional

Name of a tag which must not be present on the DNS record. Tag filters are case-insensitive.

contains: string
Optional

A tag and value, of the form <tag-name>:<tag-value>. The API will only return DNS records that have a tag named <tag-name> whose value contains <tag-value>. Tag filters are case-insensitive.

endswith: string
Optional

A tag and value, of the form <tag-name>:<tag-value>. The API will only return DNS records that have a tag named <tag-name> whose value ends with <tag-value>. Tag filters are case-insensitive.

exact: string
Optional

A tag and value, of the form <tag-name>:<tag-value>. The API will only return DNS records that have a tag named <tag-name> whose value is <tag-value>. Tag filters are case-insensitive.

present: string
Optional

Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.

startswith: string
Optional

A tag and value, of the form <tag-name>:<tag-value>. The API will only return DNS records that have a tag named <tag-name> whose value starts with <tag-value>. Tag filters are case-insensitive.

}
tag_match:
Optional

Whether to match all tag search requirements or at least one (any). If set to all, acts like a logical AND between tag filters. If set to any, acts like a logical OR instead. Note that the regular match parameter is still used to combine the resulting condition with other filters that aren't related to tags.

"any"
"all"
type:
Optional

Record type.

"A"
"AAAA"
"CAA"
"CERT"
"CNAME"
"DNSKEY"
"DS"
"HTTPS"
"LOC"
"MX"
"NAPTR"
"NS"
"OPENPGPKEY"
"PTR"
"SMIMEA"
"SRV"
"SSHFP"
"SVCB"
"TLSA"
"TXT"
"URI"
Response fields
errors: Array<>
messages: Array<>
success: true

Whether the API call was successful

result: Array< | | | 18 more...>
Optional
result_info: { count, page, per_page, 1 more... }
Optional
Request example
200Example
Scan DNS Records -> Envelope<{ recs_added, total_records_parsed }>
post/zones/{zone_id}/dns_records/scan

Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.

Overwrite DNS Record -> Envelope< | | | 18 more...>
put/zones/{zone_id}/dns_records/{dns_record_id}

Overwrite an existing DNS record.

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.

Domain types

ARecord = { comment, content, name, 5 more... }
AAAARecord = { comment, content, name, 5 more... }
CAARecord = { comment, content, data, 6 more... }
CERTRecord = { comment, content, data, 6 more... }
CNAMERecord = { comment, content, name, 5 more... }
DNSKEYRecord = { comment, content, data, 6 more... }
DSRecord = { comment, content, data, 6 more... }
HTTPSRecord = { comment, content, data, 6 more... }
LOCRecord = { comment, content, data, 6 more... }
MXRecord = { comment, content, name, 6 more... }
NAPTRRecord = { comment, content, data, 6 more... }
NSRecord = { comment, content, name, 5 more... }
PTRRecord = { comment, content, name, 5 more... }
Record = | | | 18 more...
RecordTags = string
SMIMEARecord = { comment, content, data, 6 more... }
SRVRecord = { comment, content, data, 6 more... }
SSHFPRecord = { comment, content, data, 6 more... }
SVCBRecord = { comment, content, data, 6 more... }
TLSARecord = { comment, content, data, 6 more... }
TTL = number | 1
TXTRecord = { comment, content, name, 5 more... }
URIRecord = { comment, content, data, 7 more... }
DNS

Settings

dns.settings

Methods

Update DNS Settings -> Envelope<{ zone_defaults }>
patch/{account_or_zone}/{account_or_zone_id}/dns_settings

Update DNS settings for an account or zone

Show DNS Settings -> Envelope<{ zone_defaults }>
get/{account_or_zone}/{account_or_zone_id}/dns_settings

Show DNS settings for an account or zone

Domain types

DNSSetting = { flatten_all_cnames, foundation_dns, multi_provider, 4 more... }

dns.settings.views

Methods

Create Internal DNS View -> Envelope<{ id, created_time, modified_time, 2 more... }>
post/accounts/{account_id}/dns_settings/views

Create Internal DNS View for an account

Delete Internal DNS View -> Envelope<{ id }>
delete/accounts/{account_id}/dns_settings/views/{view_id}

Delete an existing Internal DNS View

Update Internal DNS View -> Envelope<{ id, created_time, modified_time, 2 more... }>
patch/accounts/{account_id}/dns_settings/views/{view_id}

Update an existing Internal DNS View

DNS Internal View Details -> Envelope<{ id, created_time, modified_time, 2 more... }>
get/accounts/{account_id}/dns_settings/views/{view_id}

Get DNS Internal View

List Internal DNS Views -> V4PagePaginationArray<{ id, created_time, modified_time, 2 more... }>
get/accounts/{account_id}/dns_settings/views

List DNS Internal Views for an Account

DNS

Zone Transfers

dns.zone_transfers

dns.zone_transfers.acls

Methods

Create ACL -> Envelope<>
post/accounts/{account_id}/secondary_dns/acls

Create ACL.

Delete ACL -> Envelope<{ id }>
delete/accounts/{account_id}/secondary_dns/acls/{acl_id}

Delete ACL.

ACL Details -> Envelope<>
get/accounts/{account_id}/secondary_dns/acls/{acl_id}

Get ACL.

List ACLs -> SinglePage<>
get/accounts/{account_id}/secondary_dns/acls

List ACLs.

Update ACL -> Envelope<>
put/accounts/{account_id}/secondary_dns/acls/{acl_id}

Modify ACL.

Domain types

ACL = { id, ip_range, name }

dns.zone_transfers.force_axfr

Methods

Force AXFR -> Envelope<>
post/zones/{zone_id}/secondary_dns/force_axfr

Sends AXFR zone transfer request to primary nameserver(s).

Domain types

ForceAXFR = string

dns.zone_transfers.incoming

Methods

Create Secondary Zone Configuration -> Envelope<{ id, auto_refresh_seconds, checked_time, 5 more... }>
post/zones/{zone_id}/secondary_dns/incoming

Create secondary zone configuration for incoming zone transfers.

Delete Secondary Zone Configuration -> Envelope<{ id }>
delete/zones/{zone_id}/secondary_dns/incoming

Delete secondary zone configuration for incoming zone transfers.

Secondary Zone Configuration Details -> Envelope<{ id, auto_refresh_seconds, checked_time, 5 more... }>
get/zones/{zone_id}/secondary_dns/incoming

Get secondary zone configuration for incoming zone transfers.

Update Secondary Zone Configuration -> Envelope<{ id, auto_refresh_seconds, checked_time, 5 more... }>
put/zones/{zone_id}/secondary_dns/incoming

Update secondary zone configuration for incoming zone transfers.

Domain types

Incoming = { id, auto_refresh_seconds, checked_time, 5 more... }

dns.zone_transfers.outgoing

Methods

Create Primary Zone Configuration -> Envelope<{ id, checked_time, created_time, 4 more... }>
post/zones/{zone_id}/secondary_dns/outgoing

Create primary zone configuration for outgoing zone transfers.

Delete Primary Zone Configuration -> Envelope<{ id }>
delete/zones/{zone_id}/secondary_dns/outgoing

Delete primary zone configuration for outgoing zone transfers.

Disable Outgoing Zone Transfers -> Envelope<>
post/zones/{zone_id}/secondary_dns/outgoing/disable

Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone.

Enable Outgoing Zone Transfers -> Envelope<>
post/zones/{zone_id}/secondary_dns/outgoing/enable

Enable outgoing zone transfers for primary zone.

Force DNS Notify -> Envelope<string>
post/zones/{zone_id}/secondary_dns/outgoing/force_notify

Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.

Primary Zone Configuration Details -> Envelope<{ id, checked_time, created_time, 4 more... }>
get/zones/{zone_id}/secondary_dns/outgoing

Get primary zone configuration for outgoing zone transfers.

Update Primary Zone Configuration -> Envelope<{ id, checked_time, created_time, 4 more... }>
put/zones/{zone_id}/secondary_dns/outgoing

Update primary zone configuration for outgoing zone transfers.

Domain types

DisableTransfer = string
EnableTransfer = string
Outgoing = { id, checked_time, created_time, 4 more... }
OutgoingStatus = string

dns.zone_transfers.outgoing.status

Methods

Get Outgoing Zone Transfer Status -> Envelope<>
get/zones/{zone_id}/secondary_dns/outgoing/status

Get primary zone transfer status.

dns.zone_transfers.peers

Methods

Create Peer -> Envelope<>
post/accounts/{account_id}/secondary_dns/peers

Create Peer.

Delete Peer -> Envelope<{ id }>
delete/accounts/{account_id}/secondary_dns/peers/{peer_id}

Delete Peer.

Peer Details -> Envelope<>
get/accounts/{account_id}/secondary_dns/peers/{peer_id}

Get Peer.

List Peers -> SinglePage<>
get/accounts/{account_id}/secondary_dns/peers

List Peers.

Update Peer -> Envelope<>
put/accounts/{account_id}/secondary_dns/peers/{peer_id}

Modify Peer.

Domain types

Peer = { id, name, ip, 3 more... }

dns.zone_transfers.tsigs

Methods

Create TSIG -> Envelope<>
post/accounts/{account_id}/secondary_dns/tsigs

Create TSIG.

Delete TSIG -> Envelope<{ id }>
delete/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}

Delete TSIG.

TSIG Details -> Envelope<>
get/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}

Get TSIG.

List TSIGs -> SinglePage<>
get/accounts/{account_id}/secondary_dns/tsigs

List TSIGs.

Update TSIG -> Envelope<>
put/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}

Modify TSIG.

Domain types

TSIG = { id, algo, name, 1 more... }