dnslib
Simple library to encode/decode DNS wire-format packets
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
BSD (permissive) — BSD license permits commercial and private use with minimal restrictions, requiring only preservation of copyright and license notices.
last release 2025-03-03 (529 days) · last repo commit 2025-03-02 · 327 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,496,054 downloads/mo, #3,837 on PyPI
Alternatives
Verify before relying
import binascii
from dnslib import DNSRecord
packet = binascii.unhexlify(b'd5ad818000010005000000000377777706676f6f676c6503636f6d0000010001c00c0005000100000005000803777777016cc010c02c0001000100000005000442f95b68c02c0001000100000005000442f95b63c02c0001000100000005000442f95b67c02c0001000100000005000442f95b93')
d = DNSRecord.parse(packet)
print(d)- 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
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 on this page. Verify before relying on it.
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
dnslib on PyPI
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 | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 529 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,496,054 / month, #3,837 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Internet :: Name Service (DNS) |
Evidence: dnslib-0.9.26-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “DNS packet encoding decoding”
- dnslibEncodes and decodes DNS wire-format packets, supporting creation of…
- idnaConverts domain names between Unicode and ASCII-compatible encoding…
- rtpDecodes, encodes, and manipulates RTP (Real-time Transport Protocol)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Name Service (DNS) packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
dnspython is a DNS toolkit that handles queries, zone transfers, dynamic updates, TSIG authentication, and EDNS0, with support for nearly all DNS record types and both high-level and low-level API access.
Install it if you need DNS queries, zone operations, or DNSSEC validation in Python; avoid it only if you need simple hostname resolution.
Validates fully-qualified domain names (FQDNs) against RFC 1123 standards, checking whether a string would be acceptable as a public Internet hostname, with configurable relaxations for short names or underscores.
Represents and manipulates IPv4, IPv6, MAC addresses and related network objects; supports CIDR notation, subnetting, set operations, IANA lookups, and DNS reverse generation.
Extracts the public suffix and registrable domain from a domain name using the Public Suffix List, with support for IDNA encoding, wildcard handling, and strict validation.
However, do not use it if you require current public suffix data—the bundled list is from 2019-12-21 and the project is abandoned.
Parses the Public Suffix List to extract the public and private (registrable) portions of domain names, with support for internationalized domain names and Punycode.
Install it if you need reliable public suffix parsing; the daily-updated built-in list and pure-Python implementation make it a practical choice.
See also nslookup · py3dns · pycares · xdrlib3 · aws-cdk.aws-route53 · aiodns · dns-lexicon · mda-xdrlib · cbor2