DNS
Scan
Scan DNS Records.
Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. |
$response = $client->dns()->scan('ZONE_ID');
Trigger Scan
Trigger an asynchronous scan for common DNS records on a domain.
Unlike the deprecated scan(), this does not add anything to the
zone. The scan runs in the background; read what it found with
scannedRecords() and decide record by record with reviewScan().
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. |
$response = $client->dns()->triggerScan('ZONE_ID');
Scanned Records
List the DNS records discovered so far by the asynchronous scan.
These records are temporary until accepted or rejected through
reviewScan(), and the scan may turn up more of them afterwards.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. |
$response = $client->dns()->scannedRecords('ZONE_ID');
Review Scan
Accept or reject DNS records found by the scan.
Accepted records are permanently added to the zone; rejected ones are permanently deleted.
$client->dns()->reviewScan('ZONE_ID', accepts: ['record_id_a'], rejects: ['record_id_b']);
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
accepts | array | No | [] | Scanned records to add to the zone. |
rejects | array | No | [] | Scanned records to discard. |
$response = $client->dns()->reviewScan('ZONE_ID', [], []);
Batch
Send a batch of DNS record changes to be executed together.
Cloudflare runs the batch in a single database transaction, but propagation is not atomic: its distributed store treats each record as its own key, so changes become visible independently.
$client->dns()->batch('ZONE_ID', [
'posts' => [['type' => 'A', 'name' => 'www', 'content' => '198.51.100.4']],
'deletes' => [['id' => 'record_id']],
]);
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
values | array | Yes | Any of `posts` (create), `puts` (overwrite), `patches` (partial update) and `deletes`, each a list of record operations. | |
params | array | No | [] | Query Parameters: `include_shadow_metadata`. |
$response = $client->dns()->batch('ZONE_ID', [], []);
Usage
Get the current DNS record usage and quota for an account.
May include internal DNS usage and quota alongside the public zones'.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. |
$response = $client->dns()->usage('ACCOUNT_ID');
List
List, search, sort, and filter a zones' DNS records.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
params | array | No | [] | Query Parameters |
$response = $client->dns()->list('ZONE_ID', []);
Create
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.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
values | array | Yes | Values to set on DNS. |
$response = $client->dns()->create('ZONE_ID', []);
Export
Export BIND config.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. |
$response = $client->dns()->export('ZONE_ID');
Import
Import BIND config.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
content | string | Yes | Content of BIND config to import. | |
proxied | bool | No | true | Should DNS records be proxied. |
$response = $client->dns()->import('ZONE_ID', 'CONTENT', true);
Get
DNS Record Details
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
dnsRecordId | string | Yes | DNS ID to fetch details. |
$response = $client->dns()->get('ZONE_ID', 'DNS_RECORD_ID');
Edit
Apply changes to an existing DNS record, overwriting only the supplied properties.
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.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
dnsRecordId | string | Yes | DNS ID to update. | |
values | array | Yes |
$response = $client->dns()->edit('ZONE_ID', 'DNS_RECORD_ID', []);
Update
Update an existing DNS record, overwriting the full configuration.
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.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
dnsRecordId | string | Yes | DNS ID to overwrite. | |
values | array | Yes |
$response = $client->dns()->update('ZONE_ID', 'DNS_RECORD_ID', []);
Delete
Delete DNS Record
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
dnsRecordId | string | Yes | DNS ID to delete. |
$response = $client->dns()->delete('ZONE_ID', 'DNS_RECORD_ID');

