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%
Build a tool that reads DNS zone files and validates their structure, producing a report of the records found.
The tool should handle zone files with various record types and directives.
The tool should identify valid and invalid records in the zone file.
The tool should produce a structured summary of the parsed zone file.
@generates
def parse_zone_file(zone_content: str, origin: str = None, ttl: int = None) -> list:
"""
Parse DNS zone file content and return list of resource records.
Args:
zone_content: String containing zone file data
origin: Default origin domain (optional)
ttl: Default TTL value (optional)
Returns:
List of parsed DNS resource records
Raises:
Exception: If zone file contains invalid syntax
"""
pass
def validate_zone_records(records: list) -> dict:
"""
Validate parsed zone records and return validation result.
Args:
records: List of DNS resource records to validate
Returns:
Dictionary with keys:
- 'valid': Boolean indicating if all records are valid
- 'errors': List of validation error messages (empty if valid)
"""
pass
def generate_zone_summary(records: list) -> dict:
"""
Generate summary statistics from parsed zone records.
Args:
records: List of DNS resource records
Returns:
Dictionary with keys:
- 'record_counts': Dict mapping record type names to counts
- 'unique_domains': List of unique domain names found
"""
passProvides DNS record parsing and zone file format support.