dns-zone-toolkit

Validated DNS zone file parser and analysis toolkit for MoonBit

dns
zone-file
bind
parser
rfc1035
moon add lmclmc1/dns-zone-toolkit@0.1.0
Download zip
Author
Version
0.1.0
License
Apache-2.0
Last updated
6 days ago
Downloads
4
README

#lmclmc1/dns-zone-toolkit

MoonBit toolkit for parsing, validating, querying, comparing and rendering caller-provided DNS zone text.

Version 0.1.0 implements a documented BIND master-file style subset:

  • $ORIGIN, $TTL, owner inheritance and TTL inheritance;
  • A, AAAA, NS, CNAME, PTR, MX, TXT, SRV, CAA and SOA typed data;
  • generic preservation for other syntactically valid record types;
  • authoritative-zone policy checks and source-positioned diagnostics;
  • deterministic rendering, indexes, bounded CNAME traversal and comparison;
  • in-zone target reference audits for NS, CNAME, MX, SRV and SOA data;
  • owner/type record sets with exact duplicate evidence and JSON reports;
  • statistics, text/JSON evidence, bounded batches and controlled transforms.

import {
"lmclmc1/dns-zone-toolkit" @zone,
}

let document = @zone.parse_zone(
"$ORIGIN example.\n$TTL 1h\nwww A 192.0.2.1",
).unwrap()
println(@zone.render_zone(document))

The package accepts strings and performs no filesystem or network I/O. Version 0.1.0 does not implement $INCLUDE loading, DNS wire packets, DNS servers, recursive resolution, DNSSEC validation or IDN conversion.

See the repository README for complete examples, tested behavior and current boundaries. Licensed under Apache-2.0.

#
CaaRecordData

pub struct CaaRecordData {
flags_value : Int
tag_value : String
value_value : String
} derive(Eq,
Debug
)

#
CaaRecordData::flags

fn CaaRecordData::flags(self : CaaRecordData) -> Int

#
CaaRecordData::tag

fn CaaRecordData::tag(self : CaaRecordData) -> String

#
CaaRecordData::value

fn CaaRecordData::value(self : CaaRecordData) -> String

#
CnameResolution

pub struct CnameResolution {
chain_values : Array[DomainName]
terminal_record_values : Array[ZoneRecord]
} derive(Eq,
Debug
)

#
CnameResolution::chain

#
CnameResolution::chain_texts

fn CnameResolution::chain_texts(self : CnameResolution) -> Array[String]

#
CnameResolution::terminal_records

fn CnameResolution::terminal_records(self : CnameResolution) -> Array[ZoneRecord]

#
DomainName

pub struct DomainName {
label_values : Array[String]
absolute_value : Bool
} derive(Eq,
Debug
)

#
DomainName::is_absolute

fn DomainName::is_absolute(self : DomainName) -> Bool

#
DomainName::labels

fn DomainName::labels(self : DomainName) -> Array[String]

#
DomainName::resolve

fn DomainName::resolve(self : DomainName, origin : DomainName) -> Result[DomainName, ZoneError]

#
DomainName::to_text

fn DomainName::to_text(self : DomainName) -> String

#
DomainName::wire_length

fn DomainName::wire_length(self : DomainName) -> Int

#
FindingSeverity

pub(all) enum FindingSeverity {
FindingInfo
FindingWarning
FindingError
} derive(Eq,
Debug
)

#
GenericRecordData

pub struct GenericRecordData {
record_type_value : String
field_values : Array[String]
} derive(Eq,
Debug
)

#
GenericRecordData::fields

fn GenericRecordData::fields(self : GenericRecordData) -> Array[String]

#
GenericRecordData::record_type

fn GenericRecordData::record_type(self : GenericRecordData) -> String

#
Ipv4Address

pub struct Ipv4Address {
octet_values : Array[Int]
} derive(Eq,
Debug
)

#
Ipv4Address::octets

fn Ipv4Address::octets(self : Ipv4Address) -> Array[Int]

#
Ipv4Address::to_text

fn Ipv4Address::to_text(self : Ipv4Address) -> String

#
Ipv6Address

pub struct Ipv6Address {
group_values : Array[Int]
} derive(Eq,
Debug
)

#
Ipv6Address::groups

fn Ipv6Address::groups(self : Ipv6Address) -> Array[Int]

#
Ipv6Address::to_text

fn Ipv6Address::to_text(self : Ipv6Address) -> String

#
MxRecordData

pub struct MxRecordData {
preference_value : Int
exchange_value : DomainName
} derive(Eq,
Debug
)

#
MxRecordData::exchange

fn MxRecordData::exchange(self : MxRecordData) -> DomainName

#
MxRecordData::preference

fn MxRecordData::preference(self : MxRecordData) -> Int

#
RecordChange

pub struct RecordChange {
kind_value : RecordChangeKind
left_value : ZoneRecord?
right_value : ZoneRecord?
} derive(Eq,
Debug
)

#
RecordChange::kind

#
RecordChange::left

fn RecordChange::left(self : RecordChange) -> ZoneRecord?

#
RecordChange::right

fn RecordChange::right(self : RecordChange) -> ZoneRecord?

#
RecordChangeKind

pub(all) enum RecordChangeKind {
RecordAdded
RecordRemoved
RecordTtlChanged
RecordDataChanged
} derive(Eq,
Debug
)

#
RecordData

pub(all) enum RecordData {
AData(Ipv4Address)
AaaaData(Ipv6Address)
NsData(DomainName)
CnameData(DomainName)
PtrData(DomainName)
MxData(MxRecordData)
TxtData(Array[String])
SrvData(SrvRecordData)
CaaData(CaaRecordData)
SoaData(SoaRecordData)
GenericData(GenericRecordData)
} derive(Eq,
Debug
)

#
RecordTypeCount

pub struct RecordTypeCount {
type_value : String
count_value : Int
} derive(Eq,
Debug
)

#
RecordTypeCount::count

fn RecordTypeCount::count(self : RecordTypeCount) -> Int

#
RecordTypeCount::record_type

fn RecordTypeCount::record_type(self : RecordTypeCount) -> String

#
ReferenceCandidate

type ReferenceCandidate derive(Eq,
Debug
)

#
SoaRecordData

pub struct SoaRecordData {
primary_name_value : DomainName
responsible_name_value : DomainName
serial_value : UInt64
refresh_value : Ttl
retry_value : Ttl
expire_value : Ttl
minimum_value : Ttl
} derive(Eq,
Debug
)

#
SoaRecordData::expire

fn SoaRecordData::expire(self : SoaRecordData) -> Ttl

#
SoaRecordData::minimum

fn SoaRecordData::minimum(self : SoaRecordData) -> Ttl

#
SoaRecordData::primary_name

fn SoaRecordData::primary_name(self : SoaRecordData) -> DomainName

#
SoaRecordData::refresh

fn SoaRecordData::refresh(self : SoaRecordData) -> Ttl

#
SoaRecordData::responsible_name

fn SoaRecordData::responsible_name(self : SoaRecordData) -> DomainName

#
SoaRecordData::retry

fn SoaRecordData::retry(self : SoaRecordData) -> Ttl

#
SoaRecordData::serial

fn SoaRecordData::serial(self : SoaRecordData) -> UInt64

#
SourceSpan

pub(all) struct SourceSpan {
start_line_value : Int
start_column_value : Int
end_line_value : Int
end_column_value : Int
} derive(Eq,
Debug
)

#
SourceSpan::end_column

fn SourceSpan::end_column(self : SourceSpan) -> Int

#
SourceSpan::end_line

fn SourceSpan::end_line(self : SourceSpan) -> Int

#
SourceSpan::point

fn SourceSpan::point(line : Int, column : Int) -> SourceSpan

#
SourceSpan::range

fn SourceSpan::range(start_line : Int, start_column : Int, end_line : Int, end_column : Int) -> SourceSpan

#
SourceSpan::start_column

fn SourceSpan::start_column(self : SourceSpan) -> Int

#
SourceSpan::start_line

fn SourceSpan::start_line(self : SourceSpan) -> Int

#
SrvRecordData

pub struct SrvRecordData {
priority_value : Int
weight_value : Int
port_value : Int
target_value : DomainName
} derive(Eq,
Debug
)

#
SrvRecordData::port

fn SrvRecordData::port(self : SrvRecordData) -> Int

#
SrvRecordData::priority

fn SrvRecordData::priority(self : SrvRecordData) -> Int

#
SrvRecordData::target

fn SrvRecordData::target(self : SrvRecordData) -> DomainName

#
SrvRecordData::weight

fn SrvRecordData::weight(self : SrvRecordData) -> Int

#
Ttl

pub(all) struct Ttl {
seconds_value : UInt64
} derive(Eq,
Debug
)

#
Ttl::from_seconds

fn Ttl::from_seconds(seconds : UInt64) -> Result[Ttl, ZoneError]

#
Ttl::seconds

fn Ttl::seconds(self : Ttl) -> UInt64

#
Ttl::to_text

fn Ttl::to_text(self : Ttl) -> String

#
ZoneBatch

pub struct ZoneBatch {
item_values : Array[ZoneBatchItem]
accepted_count_value : Int
rejected_count_value : Int
parse_failed_count_value : Int
total_record_count_value : Int
} derive(Eq,
Debug
)

#
ZoneBatch::accepted_count

fn ZoneBatch::accepted_count(self : ZoneBatch) -> Int

#
ZoneBatch::items

fn ZoneBatch::items(self : ZoneBatch) -> Array[ZoneBatchItem]

#
ZoneBatch::parse_failed_count

fn ZoneBatch::parse_failed_count(self : ZoneBatch) -> Int

#
ZoneBatch::rejected_count

fn ZoneBatch::rejected_count(self : ZoneBatch) -> Int

#
ZoneBatch::total_record_count

fn ZoneBatch::total_record_count(self : ZoneBatch) -> Int

#
ZoneBatchInput

pub struct ZoneBatchInput {
label_value : String
text_value : String
initial_origin_value : DomainName?
initial_ttl_value : Ttl?
} derive(Eq,
Debug
)

#
ZoneBatchInput::initial_origin

fn ZoneBatchInput::initial_origin(self : ZoneBatchInput) -> DomainName?

#
ZoneBatchInput::initial_ttl

fn ZoneBatchInput::initial_ttl(self : ZoneBatchInput) -> Ttl?

#
ZoneBatchInput::label

fn ZoneBatchInput::label(self : ZoneBatchInput) -> String

#
ZoneBatchInput::new

fn ZoneBatchInput::new(label : String, text : String, initial_origin? : DomainName?, initial_ttl? : Ttl?) -> Result[ZoneBatchInput, ZoneError]

#
ZoneBatchInput::text

fn ZoneBatchInput::text(self : ZoneBatchInput) -> String

#
ZoneBatchItem

pub struct ZoneBatchItem {
label_value : String
document_value : ZoneDocument?
validation_value : ZoneValidation?
statistics_value : ZoneStatistics?
parse_error_value : ZoneError?
} derive(Eq,
Debug
)

#
ZoneBatchItem::accepted

fn ZoneBatchItem::accepted(self : ZoneBatchItem) -> Bool

#
ZoneBatchItem::document

fn ZoneBatchItem::document(self : ZoneBatchItem) -> ZoneDocument?

#
ZoneBatchItem::label

fn ZoneBatchItem::label(self : ZoneBatchItem) -> String

#
ZoneBatchItem::parse_error

fn ZoneBatchItem::parse_error(self : ZoneBatchItem) -> ZoneError?

#
ZoneBatchItem::parsed

fn ZoneBatchItem::parsed(self : ZoneBatchItem) -> Bool

#
ZoneBatchItem::statistics

fn ZoneBatchItem::statistics(self : ZoneBatchItem) -> ZoneStatistics?

#
ZoneBatchItem::validation

fn ZoneBatchItem::validation(self : ZoneBatchItem) -> ZoneValidation?

#
ZoneComparison

pub struct ZoneComparison {
change_values : Array[RecordChange]
added_count_value : Int
removed_count_value : Int
ttl_changed_count_value : Int
data_changed_count_value : Int
} derive(Eq,
Debug
)

#
ZoneComparison::added_count

fn ZoneComparison::added_count(self : ZoneComparison) -> Int

#
ZoneComparison::changes

#
ZoneComparison::data_changed_count

fn ZoneComparison::data_changed_count(self : ZoneComparison) -> Int

#
ZoneComparison::identical

fn ZoneComparison::identical(self : ZoneComparison) -> Bool

#
ZoneComparison::removed_count

fn ZoneComparison::removed_count(self : ZoneComparison) -> Int

#
ZoneComparison::ttl_changed_count

fn ZoneComparison::ttl_changed_count(self : ZoneComparison) -> Int

#
ZoneDirective

pub(all) enum ZoneDirective {
OriginDirective(DomainName)
DefaultTtlDirective(Ttl)
} derive(Eq,
Debug
)

#
ZoneDocument

pub struct ZoneDocument {
record_values : Array[ZoneRecord]
origin_value : DomainName?
default_ttl_value : Ttl?
directive_count_value : Int
} derive(Eq,
Debug
)

#
ZoneDocument::default_ttl

fn ZoneDocument::default_ttl(self : ZoneDocument) -> Ttl?

#
ZoneDocument::directive_count

fn ZoneDocument::directive_count(self : ZoneDocument) -> Int

#
ZoneDocument::origin

fn ZoneDocument::origin(self : ZoneDocument) -> DomainName?

#
ZoneDocument::records

fn ZoneDocument::records(self : ZoneDocument) -> Array[ZoneRecord]

#
ZoneError

pub struct ZoneError {
code_value : String
message_value : String
span_value : SourceSpan
} derive(Eq,
Debug
)

#
ZoneError::code

fn ZoneError::code(self : ZoneError) -> String

#
ZoneError::end_column

fn ZoneError::end_column(self : ZoneError) -> Int

#
ZoneError::end_line

fn ZoneError::end_line(self : ZoneError) -> Int

#
ZoneError::message

fn ZoneError::message(self : ZoneError) -> String

#
ZoneError::new

fn ZoneError::new(code : ZoneErrorCode, message : String, span : SourceSpan) -> ZoneError

#
ZoneError::span

fn ZoneError::span(self : ZoneError) -> SourceSpan

#
ZoneError::start_column

fn ZoneError::start_column(self : ZoneError) -> Int

#
ZoneError::start_line

fn ZoneError::start_line(self : ZoneError) -> Int

#
ZoneErrorCode

pub(all) enum ZoneErrorCode {
InvalidCharacter
UnterminatedQuote
UnterminatedEscape
UnbalancedParenthesis
TokenLimitExceeded
InvalidDomainName
InvalidDomainLabel
DomainNameTooLong
RelativeNameWithoutOrigin
InvalidTtl
TtlOverflow
InvalidDirective
UnsupportedDirective
MissingRecordField
InvalidRecordClass
InvalidRecordType
InvalidRecordData
NumericFieldOutOfRange
DuplicateSingletonRecord
ConflictingCname
MissingSoa
MissingApexNs
IntegrityViolation
} derive(Eq,
Debug
)

#
ZoneErrorCode::code

fn ZoneErrorCode::code(self : ZoneErrorCode) -> String

#
ZoneFinding

pub struct ZoneFinding {
code_value : String
severity_value : FindingSeverity
message_value : String
owner_value : DomainName?
} derive(Eq,
Debug
)

#
ZoneFinding::code

fn ZoneFinding::code(self : ZoneFinding) -> String

#
ZoneFinding::message

fn ZoneFinding::message(self : ZoneFinding) -> String

#
ZoneFinding::owner

fn ZoneFinding::owner(self : ZoneFinding) -> DomainName?

#
ZoneFinding::severity

fn ZoneFinding::severity(self : ZoneFinding) -> FindingSeverity

#
ZoneIndex

pub struct ZoneIndex {
record_values : Array[ZoneRecord]
owner_values : Array[DomainName]
} derive(Eq,
Debug
)

#
ZoneIndex::lookup

fn ZoneIndex::lookup(self : ZoneIndex, owner : DomainName, record_type : String) -> Array[ZoneRecord]

#
ZoneIndex::owner_count

fn ZoneIndex::owner_count(self : ZoneIndex) -> Int

#
ZoneIndex::owners

fn ZoneIndex::owners(self : ZoneIndex) -> Array[DomainName]

#
ZoneIndex::records

fn ZoneIndex::records(self : ZoneIndex) -> Array[ZoneRecord]

#
ZoneIndex::records_for_owner

fn ZoneIndex::records_for_owner(self : ZoneIndex, owner : DomainName) -> Array[ZoneRecord]

#
ZoneIndex::records_for_type

fn ZoneIndex::records_for_type(self : ZoneIndex, record_type : String) -> Array[ZoneRecord]

#
ZoneIndex::resolve_cname

fn ZoneIndex::resolve_cname(self : ZoneIndex, start : DomainName, max_hops? : Int) -> Result[CnameResolution, ZoneError]

#
ZonePolicy

pub struct ZonePolicy {
require_soa_value : Bool
require_apex_ns_value : Bool
enforce_cname_exclusive_value : Bool
max_records_value : Int?
max_ttl_value : Ttl?
} derive(Eq,
Debug
)

#
ZonePolicy::new

fn ZonePolicy::new(require_soa? : Bool, require_apex_ns? : Bool, enforce_cname_exclusive? : Bool, max_records? : Int?, max_ttl? : Ttl?) -> Result[ZonePolicy, ZoneError]

#
ZonePolicy::standard

fn ZonePolicy::standard() -> ZonePolicy

#
ZoneRecord

pub struct ZoneRecord {
owner_value : DomainName
ttl_value : Ttl
class_value : String
type_value : String
data_value : RecordData
explicit_ttl_value : Bool
span_value : SourceSpan
} derive(Eq,
Debug
)

#
ZoneRecord::data

fn ZoneRecord::data(self : ZoneRecord) -> RecordData

#
ZoneRecord::owner

fn ZoneRecord::owner(self : ZoneRecord) -> DomainName

#
ZoneRecord::record_class

fn ZoneRecord::record_class(self : ZoneRecord) -> String

#
ZoneRecord::record_type

fn ZoneRecord::record_type(self : ZoneRecord) -> String

#
ZoneRecord::span

fn ZoneRecord::span(self : ZoneRecord) -> SourceSpan

#
ZoneRecord::to_text

fn ZoneRecord::to_text(self : ZoneRecord) -> String

#
ZoneRecord::ttl

fn ZoneRecord::ttl(self : ZoneRecord) -> Ttl

#
ZoneRecord::ttl_was_explicit

fn ZoneRecord::ttl_was_explicit(self : ZoneRecord) -> Bool

#
ZoneRecordSet

pub struct ZoneRecordSet {
owner_value : DomainName
type_value : String
record_values : Array[ZoneRecord]
} derive(Eq,
Debug
)

#
ZoneRecordSet::count

fn ZoneRecordSet::count(self : ZoneRecordSet) -> Int

#
ZoneRecordSet::duplicate_count

fn ZoneRecordSet::duplicate_count(self : ZoneRecordSet) -> Int

#
ZoneRecordSet::duplicate_records

fn ZoneRecordSet::duplicate_records(self : ZoneRecordSet) -> Array[ZoneRecord]

#
ZoneRecordSet::owner

#
ZoneRecordSet::record_type

fn ZoneRecordSet::record_type(self : ZoneRecordSet) -> String

#
ZoneRecordSet::records

#
ZoneRecordSet::unique_record_count

fn ZoneRecordSet::unique_record_count(self : ZoneRecordSet) -> Int

#
ZoneRecordSet::unique_records

fn ZoneRecordSet::unique_records(self : ZoneRecordSet) -> Array[ZoneRecord]

#
ZoneRecordSets

pub struct ZoneRecordSets {
set_values : Array[ZoneRecordSet]
record_count_value : Int
duplicate_count_value : Int
} derive(Eq,
Debug
)

#
ZoneRecordSets::duplicate_count

fn ZoneRecordSets::duplicate_count(self : ZoneRecordSets) -> Int

#
ZoneRecordSets::for_owner

fn ZoneRecordSets::for_owner(self : ZoneRecordSets, owner : DomainName) -> Array[ZoneRecordSet]

#
ZoneRecordSets::for_type

fn ZoneRecordSets::for_type(self : ZoneRecordSets, record_type : String) -> Array[ZoneRecordSet]

#
ZoneRecordSets::has_duplicates

fn ZoneRecordSets::has_duplicates(self : ZoneRecordSets) -> Bool

#
ZoneRecordSets::largest_set_size

fn ZoneRecordSets::largest_set_size(self : ZoneRecordSets) -> Int

#
ZoneRecordSets::lookup

fn ZoneRecordSets::lookup(self : ZoneRecordSets, owner : DomainName, record_type : String) -> ZoneRecordSet?

#
ZoneRecordSets::multi_record_set_count

fn ZoneRecordSets::multi_record_set_count(self : ZoneRecordSets) -> Int

#
ZoneRecordSets::record_count

fn ZoneRecordSets::record_count(self : ZoneRecordSets) -> Int

#
ZoneRecordSets::set_count

fn ZoneRecordSets::set_count(self : ZoneRecordSets) -> Int

#
ZoneRecordSets::sets

#
ZoneRecordSets::singleton_set_count

fn ZoneRecordSets::singleton_set_count(self : ZoneRecordSets) -> Int

#
ZoneRecordSets::unique_record_count

fn ZoneRecordSets::unique_record_count(self : ZoneRecordSets) -> Int

#
ZoneReference

pub struct ZoneReference {
source_owner_value : DomainName
kind_value : ZoneReferenceKind
target_value : DomainName
internal_value : Bool
target_declared_value : Bool
address_available_value : Bool
requires_address_value : Bool
disabled_value : Bool
} derive(Eq,
Debug
)

#
ZoneReference::address_available

fn ZoneReference::address_available(self : ZoneReference) -> Bool

#
ZoneReference::disabled

fn ZoneReference::disabled(self : ZoneReference) -> Bool

#
ZoneReference::healthy

fn ZoneReference::healthy(self : ZoneReference) -> Bool

#
ZoneReference::internal

fn ZoneReference::internal(self : ZoneReference) -> Bool

#
ZoneReference::kind

#
ZoneReference::requires_address

fn ZoneReference::requires_address(self : ZoneReference) -> Bool

#
ZoneReference::source_owner

fn ZoneReference::source_owner(self : ZoneReference) -> DomainName

#
ZoneReference::target

fn ZoneReference::target(self : ZoneReference) -> DomainName

#
ZoneReference::target_declared

fn ZoneReference::target_declared(self : ZoneReference) -> Bool

#
ZoneReferenceAnalysis

pub struct ZoneReferenceAnalysis {
reference_values : Array[ZoneReference]
internal_count_value : Int
external_count_value : Int
missing_target_count_value : Int
addressless_target_count_value : Int
disabled_count_value : Int
} derive(Eq,
Debug
)

#
ZoneReferenceAnalysis::addressless_target_count

fn ZoneReferenceAnalysis::addressless_target_count(self : ZoneReferenceAnalysis) -> Int

#
ZoneReferenceAnalysis::disabled_count

fn ZoneReferenceAnalysis::disabled_count(self : ZoneReferenceAnalysis) -> Int

#
ZoneReferenceAnalysis::external_count

fn ZoneReferenceAnalysis::external_count(self : ZoneReferenceAnalysis) -> Int

#
ZoneReferenceAnalysis::healthy

fn ZoneReferenceAnalysis::healthy(self : ZoneReferenceAnalysis) -> Bool

#
ZoneReferenceAnalysis::internal_count

fn ZoneReferenceAnalysis::internal_count(self : ZoneReferenceAnalysis) -> Int

#
ZoneReferenceAnalysis::missing_target_count

fn ZoneReferenceAnalysis::missing_target_count(self : ZoneReferenceAnalysis) -> Int

#
ZoneReferenceAnalysis::references

#
ZoneReferenceKind

pub(all) enum ZoneReferenceKind {
NameServerReference
CanonicalNameReference
MailExchangeReference
ServiceTargetReference
SoaPrimaryReference
} derive(Eq,
Debug
)

#
ZoneSelection

pub struct ZoneSelection {
document_value : ZoneDocument
selected_count_value : Int
excluded_count_value : Int
} derive(Eq,
Debug
)

#
ZoneSelection::document

fn ZoneSelection::document(self : ZoneSelection) -> ZoneDocument

#
ZoneSelection::excluded_count

fn ZoneSelection::excluded_count(self : ZoneSelection) -> Int

#
ZoneSelection::selected_count

fn ZoneSelection::selected_count(self : ZoneSelection) -> Int

#
ZoneStatement

pub struct ZoneStatement {
token_values : Array[ZoneToken]
} derive(Eq,
Debug
)

#
ZoneStatement::token_texts

fn ZoneStatement::token_texts(self : ZoneStatement) -> Array[String]

#
ZoneStatement::tokens

#
ZoneStatistics

pub struct ZoneStatistics {
record_count_value : Int
owner_count_value : Int
type_count_values : Array[RecordTypeCount]
minimum_ttl_value : Ttl?
maximum_ttl_value : Ttl?
average_ttl_seconds_value : UInt64?
apex_record_count_value : Int
delegation_owner_count_value : Int
explicit_ttl_count_value : Int
} derive(Eq,
Debug
)

#
ZoneStatistics::apex_record_count

fn ZoneStatistics::apex_record_count(self : ZoneStatistics) -> Int

#
ZoneStatistics::average_ttl_seconds

fn ZoneStatistics::average_ttl_seconds(self : ZoneStatistics) -> UInt64?

#
ZoneStatistics::count_for_type

fn ZoneStatistics::count_for_type(self : ZoneStatistics, record_type : String) -> Int

#
ZoneStatistics::delegation_owner_count

fn ZoneStatistics::delegation_owner_count(self : ZoneStatistics) -> Int

#
ZoneStatistics::explicit_ttl_count

fn ZoneStatistics::explicit_ttl_count(self : ZoneStatistics) -> Int

#
ZoneStatistics::maximum_ttl

fn ZoneStatistics::maximum_ttl(self : ZoneStatistics) -> Ttl?

#
ZoneStatistics::minimum_ttl

fn ZoneStatistics::minimum_ttl(self : ZoneStatistics) -> Ttl?

#
ZoneStatistics::owner_count

fn ZoneStatistics::owner_count(self : ZoneStatistics) -> Int

#
ZoneStatistics::record_count

fn ZoneStatistics::record_count(self : ZoneStatistics) -> Int

#
ZoneStatistics::type_counts

#
ZoneToken

pub struct ZoneToken {
text_value : String
quoted_value : Bool
span_value : SourceSpan
} derive(Eq,
Debug
)

#
ZoneToken::quoted

fn ZoneToken::quoted(self : ZoneToken) -> Bool

#
ZoneToken::span

fn ZoneToken::span(self : ZoneToken) -> SourceSpan

#
ZoneToken::text

fn ZoneToken::text(self : ZoneToken) -> String

#
ZoneTtlRewrite

pub struct ZoneTtlRewrite {
document_value : ZoneDocument
changed_count_value : Int
unchanged_count_value : Int
} derive(Eq,
Debug
)

#
ZoneTtlRewrite::changed_count

fn ZoneTtlRewrite::changed_count(self : ZoneTtlRewrite) -> Int

#
ZoneTtlRewrite::document

#
ZoneTtlRewrite::unchanged_count

fn ZoneTtlRewrite::unchanged_count(self : ZoneTtlRewrite) -> Int

#
ZoneValidation

pub struct ZoneValidation {
finding_values : Array[ZoneFinding]
record_count_value : Int
} derive(Eq,
Debug
)

#
ZoneValidation::accepted

fn ZoneValidation::accepted(self : ZoneValidation) -> Bool

#
ZoneValidation::error_count

fn ZoneValidation::error_count(self : ZoneValidation) -> Int

#
ZoneValidation::findings

#
ZoneValidation::record_count

fn ZoneValidation::record_count(self : ZoneValidation) -> Int

#
ZoneValidation::warning_count

fn ZoneValidation::warning_count(self : ZoneValidation) -> Int

#
analyze_zone_references

fn analyze_zone_references(zone : ZoneDocument, max_references? : Int) -> Result[ZoneReferenceAnalysis, ZoneError]

Analyze domain-name references without treating external targets as errors.

#
build_zone_record_sets

fn build_zone_record_sets(zone : ZoneDocument, max_sets? : Int) -> Result[ZoneRecordSets, ZoneError]

Group records by owner and type and count exact duplicate evidence.

#
calculate_zone_statistics

fn calculate_zone_statistics(zone : ZoneDocument) -> ZoneStatistics

Calculate deterministic aggregate evidence for a parsed zone.

#
clamp_zone_ttls

fn clamp_zone_ttls(zone : ZoneDocument, minimum? : Ttl?, maximum? : Ttl?) -> Result[ZoneTtlRewrite, ZoneError]

Clamp record TTLs while preserving owner, class, type and record data.

#
compare_zones

fn compare_zones(left : ZoneDocument, right : ZoneDocument, max_changes? : Int) -> Result[ZoneComparison, ZoneError]

#
index_zone

fn index_zone(zone : ZoneDocument) -> ZoneIndex

#
lex_zone

fn lex_zone(text : String, max_tokens? : Int, max_token_bytes? : Int) -> Result[Array[ZoneStatement], ZoneError]

Tokenize BIND-style zone text while preserving logical statements.

#
parse_domain_name

fn parse_domain_name(text : String) -> Result[DomainName, ZoneError]

Parse an ASCII DNS presentation name without resolving a relative origin.

#
parse_ipv4

fn parse_ipv4(text : String) -> Result[Ipv4Address, ZoneError]

#
parse_ipv6

fn parse_ipv6(text : String) -> Result[Ipv6Address, ZoneError]

#
parse_record_data

fn parse_record_data(record_type : ZoneToken, fields : Array[ZoneToken], origin : DomainName) -> Result[RecordData, ZoneError]

#
parse_record_data_statement

fn parse_record_data_statement(statement : ZoneStatement, origin : DomainName) -> Result[RecordData, ZoneError]

#
parse_ttl

fn parse_ttl(text : String) -> Result[Ttl, ZoneError]

Parse a BIND-style TTL such as 3600, 2h30m or 1w2d.

#
parse_zone

fn parse_zone(text : String, initial_origin? : DomainName?, initial_ttl? : Ttl?, max_tokens? : Int, max_token_bytes? : Int) -> Result[ZoneDocument, ZoneError]

Parse a complete caller-provided zone text into resolved records.

#
parse_zone_directive

fn parse_zone_directive(statement : ZoneStatement, current_origin? : DomainName?) -> Result[ZoneDirective, ZoneError]

#
parse_zone_record

fn parse_zone_record(statement : ZoneStatement, origin : DomainName, inherited_owner? : DomainName?, inherited_ttl? : Ttl?) -> Result[ZoneRecord, ZoneError]

#
process_zone_batch

fn process_zone_batch(inputs : Array[ZoneBatchInput], policy : ZonePolicy, max_items? : Int, max_total_text_units? : Int, max_tokens_per_item? : Int, max_token_bytes? : Int) -> Result[ZoneBatch, ZoneError]

Parse and validate independent in-memory zone texts without fail-fast loss.

#
render_comparison_json

fn render_comparison_json(comparison : ZoneComparison) -> String

#
render_comparison_text

fn render_comparison_text(comparison : ZoneComparison) -> String

#
render_record_data

fn render_record_data(data : RecordData) -> String

#
render_record_sets_json

fn render_record_sets_json(sets : ZoneRecordSets) -> String

#
render_record_sets_text

fn render_record_sets_text(sets : ZoneRecordSets) -> String

#
render_reference_analysis_json

fn render_reference_analysis_json(analysis : ZoneReferenceAnalysis) -> String

#
render_reference_analysis_text

fn render_reference_analysis_text(analysis : ZoneReferenceAnalysis) -> String

#
render_statistics_json

fn render_statistics_json(statistics : ZoneStatistics) -> String

#
render_statistics_text

fn render_statistics_text(statistics : ZoneStatistics) -> String

#
render_validation_json

fn render_validation_json(validation : ZoneValidation) -> String

#
render_validation_text

fn render_validation_text(validation : ZoneValidation) -> String

#
render_zone

fn render_zone(zone : ZoneDocument) -> String

#
resolve_zone_name

fn resolve_zone_name(text : String, origin : DomainName) -> Result[DomainName, ZoneError]

#
select_zone_records

fn select_zone_records(zone : ZoneDocument, owner_subtree? : DomainName?, record_types? : Array[String]) -> Result[ZoneSelection, ZoneError]

Select records by an optional absolute owner subtree and type allow-list.

#
validate_zone

fn validate_zone(zone : ZoneDocument, policy : ZonePolicy) -> Result[ZoneValidation, ZoneError]