daverandom/libdns
Pure-PHP DNS message library for building, parsing, and manipulating DNS packets. Create queries and responses, work with resource records, headers, questions, and sections, and encode/decode wire format for custom resolvers, servers, and network tools.
composer require daverandom/libdnsResolver (for queries) and MessageBuilder/MessageParser (for constructing/parsing DNS messages)Resolver::resolve($domain, DNS::TYPE_A) to perform a simple A record lookup synchronouslyResolver class and its resolve() method, which handles query construction and transport (UDP/TCP/TLS) automaticallyAsync\Resolver adapter (if bundled) or integrate manually via ReactPHP’s event loopResolver with PSR-16 or PSR-6 cache adapters to reduce DNS load and latency—especially important for CLI tools or services making repeated lookups for the same domainTransportInterface implementation (e.g., for testing with a mock server, or enforcing DoH/DoT endpoints)Record objects to programmatically inspect TTLs, priorities (MX), or security-relevant records (e.g., verify DMARC via _dmarc TXT records)MessageBuilder to craft and send arbitrary queries (e.g., TYPE=65 for HTTPS records) without relying on external tools like digCNAME chains: The resolver does not automatically follow CNAME or DNAME records—you must manually handle redirection by inspecting the response and re-resolvingResolver with EdnsOptions or force TCP fallback if neededParser on raw binary (e.g., via @covers fixtures), not by mocking Resolver directly—actual DNS parsing is nontrivial and often misestimatedTransport to prefer IPv4 if neededHow can I help you explore Laravel packages today?