BindZoneFileParser
final class BindZoneFileParser (View source)
Parses BIND zone file text into records, handling $ORIGIN, $TTL and multi-line values.
Parses standard BIND zone file format (RFC 1035) with Cloudflare extensions. Informed by PowerDNS ZoneParserTNG patterns.
Constants
| private KNOWN_TYPES |
|
Methods
No description
No description
Infer zone origin from record names when no $ORIGIN directive is present.
Parse TTL value with optional time suffix.
Details
__construct(int $autoTtlValue = 300)
No description
ParsedZoneFile
parse(string $content)
No description
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.
int
parseTtl(string $value)
Parse TTL value with optional time suffix.
Supports: s (seconds), m (minutes), h (hours), d (days), w (weeks), y (years)