or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/dnslib@0.9.x
tile.json

tessl/pypi-dnslib

tessl install tessl/pypi-dnslib@0.9.0

Simple 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%

task.mdevals/scenario-2/

DNS Zone File Validator

Build a tool that reads DNS zone files and validates their structure, producing a report of the records found.

Capabilities

Parse standard zone file format

The tool should handle zone files with various record types and directives.

  • Parses a zone file containing A and AAAA records and extracts all resource records @test
  • Handles zone files with $TTL directive that sets the default time-to-live for records @test
  • Processes $ORIGIN directive that sets the default domain suffix @test

Validate zone records

The tool should identify valid and invalid records in the zone file.

  • Reports validation errors when the zone file contains invalid syntax @test
  • Successfully validates a well-formed zone file with mixed record types (A, MX, TXT, CNAME) @test

Generate zone summary

The tool should produce a structured summary of the parsed zone file.

  • Creates a summary report showing record count by type (e.g., 5 A records, 2 MX records) @test
  • Lists all unique domain names found in the zone file @test

Implementation

@generates

API

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
    """
    pass

Dependencies { .dependencies }

dnslib { .dependency }

Provides DNS record parsing and zone file format support.