Constructor

Record

new Record(type, metadata)

Parameter

type

string

The record type, e.g. A, AAAA, MX.

metadata

object

The metadata of this record.

Values in metadata have the following properties:

Parameter

name

string

The name of the record, e.g. www.example.com..

data

Array of string

Defined in RFC 1035, section 5 and RFC 1034, section 3.6.1.

ttl

number

Seconds that the resource is cached by resolvers.

Example

const {DNS} = require('@google-cloud/dns');
const dns = new DNS();
const zone = dns.zone('my-awesome-zone');

const record = zone.record('a', {
  name: 'example.com.',
  ttl: 86400,
  data: '1.2.3.4'
});

Properties

data

nullable Array of object

metadata

object

Properties

Parameter

name

string

data

Array of string

metadata.ttl

number

type

string

Methods

toJSON

toJSON() returns object

Serialize the record instance to the format the API expects.

Returns

object 

toString

toString() returns string

Convert the record to a string, formatted for a zone file.

Returns

string