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 utility for parsing DNS zone file records and validating their correctness for a domain authorization system.
You need to build a tool that reads DNS zone file format records and validates them according to specific business rules for a domain authorization system. The system must parse zone-formatted DNS records, extract key information, and ensure they meet certain criteria before being accepted.
Your implementation should:
@generates
def parse_zone_records(zone_text: str, origin: str = None, default_ttl: int = 3600) -> list:
"""
Parse DNS records from zone file format.
Args:
zone_text: String containing one or more zone-formatted DNS records
origin: Default origin domain for relative names
default_ttl: Default TTL value if not specified in records
Returns:
List of dictionaries, each containing:
- 'name': The domain name (str)
- 'ttl': Time to live in seconds (int)
- 'record_type': The DNS record type (str)
- 'data': Record-specific data (dict or str)
Raises:
ValueError: If zone text is malformed or invalid
"""
passProvides DNS wire-format packet encoding/decoding and zone file format support.