--- id: dnslib version: "0.9.26" license: BSD license_treatment: permissive maintenance: aging --- # dnslib — Simple library to encode/decode DNS wire-format packets License: permissive · Maintenance: aging · Downloads: 1.5M/mo ## What it is and what it does dnslib is a pure-Python library for encoding and decoding DNS packets in wire format. It provides classes to represent DNS records, questions, and complete DNS packets, and can convert between wire format, Python objects, and textual representations (zone file and DiG formats). The library includes a server framework for building custom DNS resolvers and utilities for testing and proxying DNS traffic. The package is in maintenance mode: the maintainer has decided to keep the existing API stable rather than pursue active development or modernization. It handles DNS packet parsing robustly (tested via fuzzing) and supports most standard DNS record types and operations defined in RFC1035. No runtime dependencies are required beyond Python itself. Use it for: - Parse and inspect DNS packets captured from network traffic or test data for debugging and analysis. - Build custom DNS resolvers or mock DNS servers for testing applications that depend on DNS lookups. - Convert between DNS wire format and human-readable zone file or DiG format for inspection and manipulation. - Create DNS request and response packets programmatically for DNS client implementations or testing tools. - Implement DNS proxying or interception utilities for network monitoring or traffic redirection. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Encodes and decodes DNS wire-format packets, supporting creation of DNS requests and responses, and parsing of zone file and DiG formats. Yes, if you need DNS packet encoding/decoding without external dependencies. The library is stable, permissively licensed, and has no known vulnerabilities. However, be aware it is in maintenance mode—no new features or API modernization are planned. It is suitable for production use in DNS tooling, testing, and custom resolver work, but do not expect active development or rapid responses to feature requests. ## Install pip install dnslib uv add dnslib poetry add dnslib ## Installing dnslib Before you install: Low install friction with a pure-Python wheel. Maintenance is in aging status; the maintainer has placed the package in maintenance mode, fixing minor bugs but not pursuing active development. License in practice: BSD license permits commercial and private use with minimal restrictions, requiring only preservation of copyright and license notices. Quickstart: import binascii from dnslib import DNSRecord packet = binascii.unhexlify(b'd5ad818000010005000000000377777706676f6f676c6503636f6d0000010001c00c0005000100000005000803777777016cc010c02c0001000100000005000442f95b68c02c0001000100000005000442f95b63c02c0001000100000005000442f95b67c02c0001000100000005000442f95b93') d = DNSRecord.parse(packet) print(d) Verify before relying: - Whether the package works with modern Python versions beyond those explicitly mentioned in the description - Performance characteristics when handling large numbers of DNS packets or complex zone files ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags DNS packet encoding decoding, DNS wire format library, DNS query response creation, zone file parsing, DNS resolver framework, dns, networking, packet-parsing [View on SkillFed](https://skillfed.io/packages/dnslib) · [View on PyPI](https://pypi.org/project/dnslib/)