UNPKG

ts-zone-file

Version:

This module is designed for manaing a BIND name server.

156 lines (155 loc) 3.7 kB
/** * Zone File Types */ export declare type SOA = { contact: string; serial: string; refresh: string; retry: string; expire: string; mttl: string; }; export declare type VRECORD = { host: string; value: string; ttl?: number; }; export declare type SRVRECORD = { service: string; protocol: string; host: string; ttl?: number; priority: number; weight: number; port: number; target: string; }; export declare type MXRECORD = { host: string; ttl?: number; preference: number; value: string; }; export declare enum CAATAGENUM { 'issue' = 0, 'issuewild' = 1, 'iodef' = 2 } export declare type CAATAG = CAATAGENUM | 'issue' | 'issuewild' | 'iodef'; export declare type CAARecord = { host: string; ttl?: number; flags: number; tag: CAATAG; value: string; }; /** * All the possible resource record types * {@link https://ftp.isc.org/www/bind/arm95/Bv9ARM.ch06.html#types_of_resource_records_and_when_to_use_them} */ export declare type RRType = 'ns' | 'a' | 'aaaa' | 'cname' | 'dname' | 'txt' | 'ptr' | 'srv' | 'mx' | 'caa'; /** * BIND9 Zonefile */ export declare type ZONE = { /** * Domain for the zone file */ $origin: string; /** * Optional TTL for the zonefile */ $ttl?: number; /** * SOA for the zonefile */ soa: SOA; ns: VRECORD[]; a?: VRECORD[]; aaaa?: VRECORD[]; caa?: CAARecord[]; cname?: VRECORD[]; dname?: VRECORD[]; txt?: VRECORD[]; ptr?: VRECORD[]; srv?: SRVRECORD[]; mx?: MXRECORD[]; }; /** * BIND Configuration Types */ export declare type BINDCONFIG = { include?: string[]; options: BINDOPTIONS; zones?: ZONECONFIG[]; keys?: KEYCONFIG[]; controls?: CONTROLSCONFIG; }; export declare type BINDOPTIONS = { directory?: string; pidFile?: string; dnssec?: boolean; dnssecValidation?: boolean; recursion?: boolean; alsoNotify?: string[]; listenOn?: string[]; allowTransfer?: string[]; allowRecursion?: string[]; }; export declare type UPDATEPOLICY = { grant?: string; zonesub?: string; }; export declare type ZONECONFIG = { name: string; type: ZONETYPE; file: string; autoDNSSEC?: AUTODNSSEC; inlineSigning?: boolean; keyDirectory?: string; allowTransfer?: string[]; alsoNotify?: string[]; notify?: boolean; updatePolicy?: UPDATEPOLICY; }; /** * BIND9 Zone Type {@link https://ftp.isc.org/www/bind/arm95/Bv9ARM.ch06.html#id2587159} */ export declare type ZONETYPE = ZONETYPEENUM | 'master' | 'slave' | 'stub' | 'forward' | 'hint' | 'delegation-only'; export declare enum ZONETYPEENUM { 'master' = "master", 'slave' = "slave", 'stub' = "stub", 'forward' = "forward", 'hint' = "hint" } /** * BIND9 TSIG Algroth {@link https://ftp.isc.org/www/bind/arm95/Bv9ARM.ch06.html#id2574798} */ export declare type TSIGALGORITHM = TSIGALGORITHMENUM | 'hmac-md5' | 'hmac-sha1' | 'hmac-sha224' | 'hmac-sha256' | 'hmac-sha384' | 'hmac-sha512'; export declare enum TSIGALGORITHMENUM { MD5 = "hmac-md5", SHA1 = "hmac-sha1", SHA224 = "hmac-sha224", SHA256 = "hmac-sha256", SHA384 = "hmac-sha384", SHA512 = "hmac-sha512" } export declare type AUTODNSSEC = AUTODNSSECENUM | 'off' | 'allow' | 'maintain'; export declare enum AUTODNSSECENUM { 'off' = "off", 'allow' = "allow", 'maintain' = "maintain" } export declare type KEYCONFIG = { name: string; secret: string; algorithm: TSIGALGORITHM; }; export declare type CONTROLSCONFIG = { inet: { source: string; allow: string; keys: string; }; };