DNS Records

A DNSRecord is a custom DNS configuration record for a Site.

They represent the records you will need to configure in your DNS hosting provider to allow custom domains to work with Files.com.

Show Site DNS Configuration

SDK Method

DnsRecord.list()

Return Object

DnsRecord[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import DnsRecord from 'files.com/lib/models/DnsRecord';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const dnsRecords = await DnsRecord.list();
  for (const dnsRecord of dnsRecords) {
    // Operate on dnsRecord
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

The DnsRecord Object

Some of the methods above return a DnsRecord object. The attributes of this object are listed below.

AttributeDescription
id
string
Unique label for DNS record; used by Zapier and other integrations.
domain
string
DNS record domain name
rrtype
string
DNS record type
value
string
DNS record value