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%
A lightweight async DNS helper that issues concurrent lookups while allowing callers to choose the event-loop backend (asyncio or trio).
ValueError. @testexample.com against 1.1.1.1 returns at least one IPv4 address string via the configured backend. @testexample.com, and an "AAAA" list that may be empty but is always present. @test@generates
from typing import Iterable, Literal, Sequence
BackendName = Literal["asyncio", "trio"]
class AsyncDnsClient:
def __init__(self, nameservers: Sequence[str] | None = None, backend: BackendName = "asyncio", timeout: float | None = 2.0):
"""Configure the resolver with optional nameservers, backend, and timeout seconds."""
def set_backend(self, backend: BackendName) -> None:
"""Switch the active async backend; raise ValueError for unsupported names."""
async def lookup(self, name: str, record_type: str = "A", *, nameservers: Iterable[str] | None = None) -> list[str]:
"""Resolve a single record type asynchronously using the active backend; optional nameserver override."""
async def lookup_dual_stack(self, name: str) -> dict[str, list[str]]:
"""Resolve both A and AAAA concurrently using the active backend; returns {"A": [...], "AAAA": [...]} with lists possibly empty."""Provides asynchronous DNS querying and resolver abstractions with backend selection.