2026-04-08 11:08:18 +00:00
|
|
|
/**
|
|
|
|
|
* Supported DNS record types.
|
|
|
|
|
*/
|
|
|
|
|
export type TDnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SOA' | 'CAA';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Where a DNS record came from.
|
|
|
|
|
*
|
2026-04-08 14:54:49 +00:00
|
|
|
* - 'local' → originated in this dcrouter (created via UI / API)
|
|
|
|
|
* - 'synced' → pulled from an upstream provider (Cloudflare, foreign
|
|
|
|
|
* dcrouter, …) during a sync operation
|
2026-04-08 11:08:18 +00:00
|
|
|
*/
|
2026-04-08 14:54:49 +00:00
|
|
|
export type TDnsRecordSource = 'local' | 'synced';
|
2026-04-08 11:08:18 +00:00
|
|
|
|
|
|
|
|
/**
|
2026-04-08 14:54:49 +00:00
|
|
|
* A DNS record. For dcrouter-hosted (authoritative) domains, the record is
|
|
|
|
|
* registered with the embedded smartdns.DnsServer. For provider-managed
|
|
|
|
|
* domains, the record is mirrored from / pushed to the provider API and
|
|
|
|
|
* `providerRecordId` holds the provider's internal record id (for updates
|
|
|
|
|
* and deletes).
|
2026-04-08 11:08:18 +00:00
|
|
|
*/
|
|
|
|
|
export interface IDnsRecord {
|
|
|
|
|
id: string;
|
|
|
|
|
/** ID of the parent IDomain. */
|
|
|
|
|
domainId: string;
|
|
|
|
|
/** Fully qualified record name (e.g. 'www.example.com'). */
|
|
|
|
|
name: string;
|
|
|
|
|
type: TDnsRecordType;
|
|
|
|
|
/**
|
|
|
|
|
* Record value as a string. For MX records, formatted as
|
|
|
|
|
* `<priority> <exchange>` (e.g. `10 mail.example.com`).
|
|
|
|
|
*/
|
|
|
|
|
value: string;
|
|
|
|
|
/** TTL in seconds. */
|
|
|
|
|
ttl: number;
|
|
|
|
|
/** Cloudflare-specific: whether the record is proxied through Cloudflare. */
|
|
|
|
|
proxied?: boolean;
|
|
|
|
|
source: TDnsRecordSource;
|
|
|
|
|
/** Provider's internal record id (for updates/deletes). Only set for provider records. */
|
|
|
|
|
providerRecordId?: string;
|
|
|
|
|
createdAt: number;
|
|
|
|
|
updatedAt: number;
|
|
|
|
|
createdBy: string;
|
|
|
|
|
}
|