PHP Client for Cloudflare API
Tenants

Custom Nameservers

Custom Nameservers endpoint reference.

Get

List of custom nameservers for the Tenant.

ParamTypeRequiredDefaultDescription
tenantIdstringYesTenant identifier.
php
$response = $client->tenants()->customNameservers()->get('TENANT_ID');
View this operation on the Cloudflare API Reference

Create

Add a custom nameserver to the Tenant.

$client->tenants()->customNameservers()->create('TENANT_ID', [
    'ns_name' => 'ns1.example.com',
    'ns_set' => 1,
]);
ParamTypeRequiredDefaultDescription
tenantIdstringYesTenant identifier.
valuesarrayYes`ns_name` is required and is the FQDN of the name server. `ns_set` optionally numbers the set the name server belongs to.
php
$response = $client->tenants()->customNameservers()->create('TENANT_ID', []);
View this operation on the Cloudflare API Reference

Delete

Delete a custom nameserver from the Tenant.

ParamTypeRequiredDefaultDescription
tenantIdstringYesTenant identifier.
nsNamestringYesFQDN of the name server to delete.
php
$response = $client->tenants()->customNameservers()->delete('TENANT_ID', 'NS_NAME');
View this operation on the Cloudflare API Reference
Copyright © 2026