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%
Build a client that issues DNS queries to a single configurable nameserver using multiple transports (UDP, TCP, TLS, HTTPS), falling back from UDP to TCP when needed while keeping results consistent across protocols.
example.com using UDP and returns all IPv4 addresses sorted lexicographically. @testexample.com using DNS-over-TLS against the configured endpoint and returns addresses including 93.184.216.34. @testexample.com using DNS-over-HTTPS (GET) against the configured endpoint and returns addresses including 93.184.216.34. @test@generates
class TransportClient:
def __init__(self, nameserver: str, udp_timeout: float = 2.0, tcp_timeout: float = 4.0, tls_port: int = 853, https_url: str | None = None):
"""Create a client bound to a target resolver supporting UDP/TCP/TLS and an optional HTTPS endpoint."""
def query(self, qname: str, rdtype: str = "A", transport: str = "udp") -> list[str]:
"""Execute a DNS query over the chosen transport ('udp', 'tcp', 'tls', 'https') and return the RDATA text values in order of arrival."""
def query_with_fallback(self, qname: str, rdtype: str = "A", udp_payload_size: int = 512) -> list[str]:
"""Perform a UDP query (respecting the payload size), and on truncation or timeout, retry over TCP automatically before returning results."""Python DNS toolkit for building, sending, and parsing DNS messages across multiple transports.