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 (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    dns_record "github.com/Files-com/files-sdk-go/v3/dnsrecord"
)

dnsRecordIterator, err := dns_record.List(files_sdk.DnsRecordListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for dnsRecordIterator.Next() {
    dnsRecord := dnsRecordIterator.dnsRecord()
}
err = dnsRecordIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

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