tessl install tessl/pypi-dnspython@1.16.0DNS toolkit for Python supporting almost all record types with high-level and low-level DNS operations
Agent Success
Agent success rate when using this tile
85%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.37x
Baseline
Agent success rate without this tile
62%
Implement helpers that convert DNS record text into RRsets, produce wire-format bytes, and read them back while keeping canonical record ordering. Use the DNS dependency's built-in parsing and serialization helpers rather than manual string handling.
@generates
from typing import List, Tuple
def build_rrset(name: str, ttl: int, rdclass: str, rdtype: str, records: List[str]) -> Tuple[List[str], bytes]:
"""
Build an RRset from textual RDATA strings for a single name/class/type.
Returns (normalized_records, wire_bytes) where normalized_records contains full record lines
with name, TTL, class, type, and RDATA values sorted in canonical order.
Uses the dependency's parsing and RRset helpers for construction and serialization.
"""
def parse_wire(name: str, rdclass: str, rdtype: str, wire: bytes) -> List[str]:
"""
Parse wire-format data for a single RRset into canonical textual RDATA strings.
Uses the dependency's wire-parsing helpers rather than manual decoding.
"""Provides DNS record parsing, RRset construction, and wire-format serialization utilities.