tessl install tessl/pypi-dnslib@0.9.0Simple library to encode/decode DNS wire-format packets
Agent Success
Agent success rate when using this tile
97%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.76x
Baseline
Agent success rate without this tile
55%
A Python utility that parses DNS zone file text and creates DNS resource records, properly handling zone file directives like $TTL and $ORIGIN.
The parser should correctly interpret the $TTL directive and apply it to subsequent records that don't specify an explicit TTL value.
The parser should correctly interpret the $ORIGIN directive and append it to relative domain names.
The parser should handle zone files that use both $TTL and $ORIGIN directives together.
@generates
def parse_zone_file(zone_text: str) -> list:
"""
Parses DNS zone file text and returns a list of DNS resource records.
Handles $TTL and $ORIGIN directives according to RFC 1035 zone file format.
Relative domain names are appended to the current $ORIGIN.
Records without explicit TTL values use the current $TTL directive value.
Args:
zone_text: String containing zone file format text with directives and records
Returns:
List of DNS resource record objects from the zone file
Raises:
Exception: If the zone file format is invalid
"""
passProvides DNS record parsing and zone file format support.