DnsRecord
A DnsRecord represents a single DNS resource record set within a DnsZone. It supports standard record types including A, AAAA, CNAME, MX, TXT, NS, and SRV.
Config
Section titled “Config”| Property | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | Record name (relative to zone, e.g. www or @ for apex) |
id |
string |
no | Explicit ID (auto-generated UUID if omitted) |
provider |
string |
no | Provider label for multi-provider configs |
tags |
Record<string, string> |
no | Arbitrary key-value metadata |
zone |
DnsZone | string |
yes | Parent DNS zone reference |
recordType |
'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SRV' |
yes | DNS record type |
ttl |
number |
no | Time-to-live in seconds (default 300) |
values |
string[] |
yes | Record values (e.g. IP addresses for A records) |
Example
Section titled “Example”import { DnsZone, DnsRecord } from '@kykucloud/types'
const zone = new DnsZone({ name: 'example.com' })
const aRecord = new DnsRecord({ name: 'www', zone: zone, recordType: 'A', ttl: 300, values: ['10.0.0.1', '10.0.0.2'],})
const cnameRecord = new DnsRecord({ name: 'api', zone: zone, recordType: 'CNAME', values: ['lb.example.com'],})Provider Support
Section titled “Provider Support”| Provider | Supported | Backend |
|---|---|---|
| AWS | ✅ | Route53 Record Set |
| GCP | ✅ | Cloud DNS Record Set |
| Hetzner | ✅ | DNS Record (via dns.hetzner.com/api/v1) |
| DigitalOcean | ✅ | Domain Record |
- Route53 alias records: For AWS, use provider-specific record values to create alias records (e.g. for ALB or CloudFront). Not expressed through the abstract
recordType. - TXT records: Values may need quoting depending on the provider. Kyku handles quoting automatically.
- CNAME restrictions: Cannot coexist with other record types at the same name (DNS protocol constraint). Use
@for zone apex with A/AAAA when CNAME is not allowed. - Hetzner DNS uses a separate API endpoint and token from the cloud API. Requires
HETZNER_DNS_TOKEN.