Cloudflare.editDnsRecord()

Edit a DNS record for a zone

Usage

Hover over inputs/exits for more info.

var Cloudflare = require('machinepack-cloudflare');


// Edit a DNS record for a zone

Cloudflare.editDnsRecord({

token: '8afbe6dea02407989af4dd4c97bb6e25',

email: 'sample@example.com',

domain: 'example.com',

recordId: '9001',

type: 'A',

name: 'sub',

content: '96.126.126.36',

ttl: '1',

onCloudflare: 1,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Authentication could not be completed.

notAuthorized: function () {

 

},

// Some other input was not valid.

invalidInput: function () {

 

},

// You have exceeded your allowed number of API calls.

apiLimit: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

token required

The API key made available on your Cloudflare account page.

'8afbe6dea02407989af4dd4c97bb6e25'
email required

The e-mail address associated with your Cloudflare account.

'sample@example.com'
domain required

The target domain.

'example.com'
recordId required

The DNS record ID.

'9001'
type required

Type of DNS record.

'A'
name required

Name of the DNS record.

'sub'
content required

The content of the DNS record, will depend on the the type of record being added.

'96.126.126.36'
ttl required

The TTL of record in seconds.

'1'
onCloudflare

Status of CloudFlare Proxy.

1

Exits

error

An unexpected error occurred.

notAuthorized

Authentication could not be completed.

invalidInput

Some other input was not valid.

apiLimit

You have exceeded your allowed number of API calls.

success

OK.

{ rec_id: '23734516',
  rec_tag: 'b3db8b8ad50389eb4abae7522b22852f',
  zone_name: 'example.com',
  name: 'sub.example.com',
  display_name: 'sub',
  type: 'A',
  prio: null,
  content: '96.126.126.36',
  display_content: '96.126.126.36',
  ttl: '1',
  ttl_ceil: 86400,
  ssl_id: '12805',
  ssl_status: 'V',
  ssl_expires_on: null,
  auto_ttl: 1,
  service_mode: '0',
  props: 
   { proxiable: 1,
     cloud_on: 0,
     cf_open: 1,
     ssl: 1,
     expired_ssl: 0,
     expiring_ssl: 0,
     pending_ssl: 0,
     vanity_lock: 0 } }