nslookup
Sensible high-level DNS lookups in Python, using DNSpython resolver
Decision gist · record as of 2026-08-14
Yes, if you need straightforward DNS lookups for A, AAAA, or SOA records. The single dependency, active maintenance, and low install friction make it a sensible choice for common queries. Skip it if you need advanced DNS features (other record types, DoH, complex error recovery) or bulk TCP queries—use dnspython directly instead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with a single runtime dependency (dnspython).
- Actively maintained with recent commits; repository is not archived.
License · maintenance · safety
copyleft license (copyleft) — Licensed under Mozilla Public License 2.0 (MPL 2.0), a copyleft license requiring derivative works to disclose modifications under the same license terms.
last release 2026-05-03 (103 days) · last repo commit 2026-05-03 · 23 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 107,556 downloads/mo, #12,609 on PyPI
Alternatives
Verify before relying
pip install nslookup
from nslookup import Nslookup
dns_query = Nslookup()
ips_record = dns_query.dns_lookup("example.com")
print(ips_record.answer)- Whether the library handles DNS timeouts, retries, or connection failures beyond basic exception handling
- Performance characteristics when querying many domains in sequence
- Whether custom DNS server configuration works reliably across different network environments
What it is and what it does
Nslookup is a lightweight wrapper around dnspython that simplifies DNS queries for the most common use cases: looking up A and AAAA records to resolve domain names to IP addresses, and SOA record queries. It abstracts away dnspython's lower-level API to provide straightforward functions that return parsed results and full response strings, with sensible error handling built in.
The library is intentionally narrow in scope—it does not attempt to cover all DNS record types or edge cases, and features like DNS-over-HTTPS are explicitly out of scope. It defaults to UDP queries against system DNS servers but supports custom DNS servers and TCP mode, though the documentation notes that TCP mode creates a new session per query and is resource-intensive for bulk operations.
Use it for
- Resolve domain names to IP addresses in a Python application without wrestling with dnspython's full API
- Perform SOA record lookups to check domain authority or delegation details
- Query against a specific DNS server (e.g., 1.1.1.1) instead of relying on system defaults
- Add DNS resolution to a simple script or tool with minimal dependencies and setup
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need straightforward DNS lookups for A, AAAA, or SOA records.
The single dependency, active maintenance, and low install friction make it a sensible choice for common queries. Skip it if you need advanced DNS features (other record types, DoH, complex error recovery) or bulk TCP queries—use dnspython directly instead.
Install
nslookup on PyPI
Before you install
Low friction install with a single runtime dependency (dnspython). Actively maintained with recent commits; repository is not archived.
License in practice
Licensed under Mozilla Public License 2.0 (MPL 2.0), a copyleft license requiring derivative works to disclose modifications under the same license terms.
Quickstart
pip install nslookup
from nslookup import Nslookup
dns_query = Nslookup()
ips_record = dns_query.dns_lookup("example.com")
print(ips_record.answer)
Verify before relying
- Whether the library handles DNS timeouts, retries, or connection failures beyond basic exception handling
- Performance characteristics when querying many domains in sequence
- Whether custom DNS server configuration works reliably across different network environments
Package facts
| License | copyleft license copyleft |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagednspython |
| Maintenance | Actively maintained 103 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 107,556 / month, #12,609 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Natural Language :: EnglishProgramming Language :: Python :: 3 |
Evidence: nslookup-1.9.0-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 query library”
- nslookupProvides high-level DNS lookups (A, AAAA, and SOA records) with clean…
- dnslibEncodes and decodes DNS wire-format packets, supporting creation of…
- py3dnsProvides synchronous DNS query functionality for Python 3, supporting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Internet packages
Botocore provides low-level, data-driven access to Amazon Web Services APIs, serving as the foundation for the AWS CLI and boto3 libraries.
Install it if you need programmatic access to AWS services.
Provides an async client for AWS services using botocore and aiohttp, allowing you to call AWS APIs asynchronously within asyncio-based applications.
Install it if you need to call AWS services from async Python code; it is the standard way to do so.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides common Protocol Buffer message definitions used across Google Cloud APIs, enabling Python clients to interact with Google services.
See also dnspython · py3dns · dnslib · ipwhois · aiodns · pycares · PyFunceble-dev · dns-lexicon · shodan · aiohttp-asyncmdnsresolver