Overview

Namespaces

  • Cloudflare
    • Organizations
      • Firewall
        • AccessRules
    • User
      • Billing
        • Subscriptions
      • Firewall
    • Zone
      • Firewall
      • SSL
      • WAF
        • Packages

Classes

  • Analytics
  • Cache
  • CustomPages
  • CustomSSL
  • Dns
  • KeylessSSL
  • Pagerules
  • Plan
  • Railgun
  • Settings
  • SSL
  • Overview
  • Namespace
  • Class

Class Dns

CloudFlare API wrapper

DNS Record CloudFlare DNS records

Cloudflare\Api
Extended by Cloudflare\Zone\Dns
Namespace: Cloudflare\Zone
Author: James Bell james@james-bell.co.uk
Version: 1
Located at CloudFlare/Zone/Dns.php
Methods summary
public
# create( string $zone_identifier, string $type, string $name, string $content, integer|null $ttl = null, boolean|null $proxied = null, integer|null $priority = null, array|null $data = null )

Create DNS record (permission needed: #dns_records:edit) Create a new DNS record for a zone. See the record object definitions for required attributes for each record type

Create DNS record (permission needed: #dns_records:edit) Create a new DNS record for a zone. See the record object definitions for required attributes for each record type

Parameters

$zone_identifier
$type
DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
$name
DNS record name
$content
DNS record content
$ttl
Time to live for DNS record. Value of 1 is 'automatic'
$proxied
Whether to proxy the domain through CloudFlare or not
$priority
MX record priority value
$data
Additional data required for SRV record
public
# list_records( string $zone_identifier, string|null $type = null, string|null $name = null, string|null $content = null, string|null $vanity_name_server_record = null, integer|null $page = null, integer|null $per_page = null, string|null $order = null, string|null $direction = null, string|null $match = null )

List DNS Records (permission needed: #dns_records:read) List, search, sort, and filter a zones' DNS records.

List DNS Records (permission needed: #dns_records:read) List, search, sort, and filter a zones' DNS records.

Parameters

$zone_identifier
$type
DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
$name
DNS record name
$content
DNS record content
$vanity_name_server_record
Flag for records that were created for the vanity name server feature (true, false)
$page
Page number of paginated results
$per_page
Number of DNS records per page
$order
Field to order records by (type, name, content, ttl, proxied)
$direction
Direction to order domains (asc, desc)
$match
Whether to match all search requirements or at least one (any) (any, all)
public
# details( string $zone_identifier, string $identifier )

DNS record details (permission needed: #dns_records:read)

DNS record details (permission needed: #dns_records:read)

Parameters

$zone_identifier
$identifier
API item identifier tag
public
# update( string $zone_identifier, string $identifier, string|null $type = null, string|null $name = null, string|null $content = null, string|null $ttl = null, boolean|null $proxied = null, array|null $data = null, integer|null $priority = null )

Update DNS record (permission needed: #dns_records:edit)

Update DNS record (permission needed: #dns_records:edit)

Parameters

$zone_identifier
$identifier
API item identifier tag
$type
DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
$name
DNS record name
$content
DNS record content
$ttl
Time to live for DNS record. Value of 1 is 'automatic'
$proxied
Whether to proxy the domain through CloudFlare or not
$data
Additional data required for SRV record
$priority
MX record priority value
public
# delete_record( string $zone_identifier, string $identifier )

Update DNS record (permission needed: #dns_records:edit)

Update DNS record (permission needed: #dns_records:edit)

Parameters

$zone_identifier
$identifier
API item identifier tag
Methods inherited from Cloudflare\Api
__construct(), delete(), get(), patch(), permissions(), post(), put(), request(), setAuthKey(), setCurlOption(), setEmail()
Properties summary
protected array $permission_level

Default permissions level

Default permissions level

# ['read' => '#dns_records:read', 'edit' => '#dns_records:edit']
Properties inherited from Cloudflare\Api
$auth_key, $curl_options, $email
API documentation generated by ApiGen