class BindZoneFileParser (View source)

BIND zone file parser.

Parses standard BIND zone file format (RFC 1035) with Cloudflare extensions. Informed by PowerDNS ZoneParserTNG patterns.

Constants

private KNOWN_TYPES

Methods

__construct(int $autoTtlValue = 300)

No description

parse(string $content)

No description

string|null
inferOrigin(array $records)

Infer zone origin from record names when no $ORIGIN directive is present.

int
parseTtl(string $value)

Parse TTL value with optional time suffix.

Details

__construct(int $autoTtlValue = 300)

No description

Parameters

int $autoTtlValue

ParsedZoneFile parse(string $content)

No description

Parameters

string $content

Return Value

ParsedZoneFile

string|null inferOrigin(array $records)

Infer zone origin from record names when no $ORIGIN directive is present.

Finds the longest common suffix of all record FQDNs. For example, records like a.example.com, b.example.com → inferred origin: example.com.

Parameters

array $records

Return Value

string|null

int parseTtl(string $value)

Parse TTL value with optional time suffix.

Supports: s (seconds), m (minutes), h (hours), d (days), w (weeks), y (years)

Parameters

string $value

Return Value

int